-   Linux - Newbie (
-   -   Need help running scripts from scripts (

sdouble 05-31-2004 02:53 AM

Need help running scripts from scripts
Let's say I have a script called "file" and I'm wanting to run the script with "file.cfg" sent to it.

Normally, I can just browse to the directory and run it there like so.
cd /path/to/script
./file "file.cfg"

What I want to do, is set up different script files to run the other script with different cfg files. I created a dir for my scripts located at /sh/

What do I put in the scripts to run the other script with different arguments sent to it? I want files /sh/runfile1, runfile2, and runfile3

I tried putting ./path/to/script/file "file.cfg" and instead of executing the file, it opens it to edit

Any help would be great, Thanks a lot!

chii-chan 05-31-2004 03:04 AM

You'll need the '.' (dot) only when you want to run the script from the current directory. Giving the full path to script without the "." would run the script.

whansard 05-31-2004 03:23 AM

make a script called script that contains
nameofscript /sh/$1

put that script in your path, then run it with
nameofscript nameofconfig

sdouble 05-31-2004 01:56 PM

Thanks guys! I'm still quite ne2w to Linux and so far the experience has been pretty fun. I just thought the . meant to execute the script. All of htem I have started have been in the same directory so I used the . each time. Thanks again!

All times are GMT -5. The time now is 07:56 AM.