LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-31-2004, 01:53 AM   #1
sdouble
LQ Newbie
 
Registered: Sep 2003
Distribution: Fedora Core 3
Posts: 23

Rep: Reputation: 15
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!
 
Old 05-31-2004, 02:04 AM   #2
chii-chan
Member
 
Registered: Sep 2003
Location: chikyuu (E103N6)
Distribution: Redhat 8.0 (2.4.25-custom), Fedora Core 1 (2.4.30-custom)
Posts: 357

Rep: Reputation: 30
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.
 
Old 05-31-2004, 02:23 AM   #3
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
make a script called script that contains
nameofscript /sh/$1

put that script in your path, then run it with
nameofscript nameofconfig
 
Old 05-31-2004, 12:56 PM   #4
sdouble
LQ Newbie
 
Registered: Sep 2003
Distribution: Fedora Core 3
Posts: 23

Original Poster
Rep: Reputation: 15
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!
 
  


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
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 12:10 PM
Running scripts bhmsi Linux - Newbie 6 04-23-2005 06:05 PM
Running scripts moeru Linux - Software 10 07-02-2004 09:42 AM
Running scripts crash_zero Mandriva 5 04-19-2004 02:23 PM
Help Running Scripts josefalero Linux - Newbie 2 11-14-2002 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:47 AM.

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
Open Source Consulting | Domain Registration