Results 1 to 4 of 4
--------------------------------------------------------------------------------
Hi,
I'm trying to call a shell script from within another scipt, but returns with a
`command not found` error msg.
script_name=$1
./$script_name &; exit 0
I think its ...
- 03-25-2010 #1Just Joined!
- Join Date
- Jun 2008
- Posts
- 58
calling a script
--------------------------------------------------------------------------------
Hi,
I'm trying to call a shell script from within another scipt, but returns with a
`command not found` error msg.
I think its something to no with the "./" bit.script_name=$1
./$script_name &; exit 0
i also tried
"./"$script_name &; and
"./$script_name" &
no luck.
Cheers
David
- 03-25-2010 #2
Did you try with absoulte path name? like
/complete/path/to/script.sh- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 03-25-2010 #3Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
Is your script executable ? (I guess so.)
Does its name contain white spaces ? (You should quote the variable.)0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.
- 03-25-2010 #4
Make sure the script has the executable bit set. And to be consistent make sure it has a she-bang in the first line. Something like:
#!/bin/bash
That is, assuming you are trying to execute bash. If it is a different script language, put in the appropriate interpreter command instead of bash.


Reply With Quote