LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-19-2003, 12:44 AM   #1
johnlb
LQ Newbie
 
Registered: Feb 2003
Posts: 12

Rep: Reputation: 0
Running a script file


I am running Suse 8.0 with bash. I created a script file that is a series similar to:

mv file1.jpg dir1
mv file2.jpg dir5
mv file3.jpg dir2
...
mv file199.jpg dir3

The file was created under Windows ME using javascript within a .hta file. This was done because the origial files are all on a fat32 partition with a javascript file listing them along with image pixel sizes. I had to reference that javascript file to determine where the files should be moved to based on height/width ratio.
Also, the file names are about 10 charactes without extention and very random in structure.

I moved the image files and the script file to Linux under /usr/local/mydir and then created the destination directories below that. I used chown and chmod so that all of the directories and the script files are owned by my non-root login, with rwx access to owner and root. When I type in the script file, it says 'command not found' with BOTH my login and as superuser.

I opened the script file in joe and it does not appear to have any DOS newline problems. I made the same test with less and it also had no strange characters displayed.

I also manually entered one of the lines on the keyboard exactly as it is listed in the script file and it worked. I am very unwilling to type it in for all files. I would rather do a drag and drop in Windows, as horrible as that sounds.

Why is the script file not working?
 
Old 02-19-2003, 01:10 AM   #2
PTBmilo
Member
 
Registered: Jan 2003
Posts: 167

Rep: Reputation: 30
Re: Running a script file

Quote:
Originally posted by johnlb
When I type in the script file, it says 'command not found' with BOTH my login and as superuser.
Did you type in the absolute path to the file, or just the name of it? If you are in the directory that it's in, you need to do './<script>' to make the shell look in the current directory for the executable.

.... that's all I can think of.
 
Old 02-19-2003, 03:17 AM   #3
johnlb
LQ Newbie
 
Registered: Feb 2003
Posts: 12

Original Poster
Rep: Reputation: 0
That solved the problem.
Thanks
John
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to start a Tcl/Tk script by simply invoking the script file itself ? cyu021 Programming 2 10-10-2004 12:00 PM
Running a script spacemonk Linux - Newbie 4 07-30-2004 05:02 AM
Probs running .jar file via CGI script under Apache blimbo Programming 1 07-22-2004 11:29 AM
Running a script on every file in a directory davee Linux - Newbie 2 11-04-2003 03:34 PM
Question on running a script zael Programming 1 09-30-2003 02:59 PM


All times are GMT -5. The time now is 01:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration