![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
sh or ./
permission of a filename.sh is -rwxr-xr-x
./filename.sh -> command not found sh filename.sh -> then success... why is that so? i suspect is the -rwxr-xr-x |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
in filename.sh check that the #! line points to sh
the #! tells what program to execute the script with... if the path is wrong to sh simply change it to where sh is on your system.. /Peter |
|
#3
|
|||
|
|||
|
in myfilename.sh, the first line is #!/bin/csh
|
|
#4
|
||||
|
||||
|
for Bourne Shell:
#!/bin/sh for C-Shell: #!/bin/csh for Korn Shell: #!/bin/ksh for Perl: #!/usr/um/bin/perl |
|
#5
|
||||
|
||||
|
and does /bin/csh exist on you system??
check it out! /Peter |
|
#6
|
||||
|
||||
|
Yls177,
The reason that the "sh filename.sh " works is because you are invoking the bourne shell. Remember "sh" is actually a command. Read the man on sh. When you use ./filename.sh, You are trying to execute the file in the current directory using its internal scripting. You must have the shell you are invoking inside the script, in the /etc/shells file. If not your script will fail.
__________________
My brain is your brain |
||||
| Google The UNIX and Linux Forums |