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! |
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.
|
make a script called script that contains
nameofscript /sh/$1 put that script in your path, then run it with nameofscript nameofconfig |
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 05:16 PM. |