Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What should be the extension

Status
Not open for further replies.

NewGuy

Programmer
Dec 28, 2000
31
CA
Hi,
I am brand new to Unix. I want to learn about shell programming. I just started reading a book. saving the files with .sh extension and trying execute them from the shell. But it is saying "xx.sh" is not a valid command.
shell variable is assigned to '/bin/csh'.
Please help me in running the shell programs,
Thanks.
 
The extension isn't important. Make sure the file is executable:

chmod +x xx.sh

AND, make sure the file's in your path. If it's in the same directory you're in, try:

shell prompt -> ./xx.sh

HTH,

Russ
bobbitts@hotmail.com
 
You also need to check that you are using the correct shell, i.e if you are running in csh and you are using korn shell scripts then you may get errors. You can tell the system what shell to use by declaring it on the first line of the script, simply put the pathe of the shell you want to use after the charecters #!
Like this: -
#!/usr/bin/ksh

this assumes ksh is in the directory /usr/bin.

Ged Jones

Top man
 
Thank you very much Russt and Jones for your valuable info.
Bye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top