![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple rm commands in my server | chickenhouse | Shell Programming and Scripting | 4 | 02-24-2008 11:14 PM |
| need help with understanding and modifying script | dakkorn | Shell Programming and Scripting | 4 | 01-24-2008 09:01 AM |
| Modifying a csv file from Shell Script | not4google | Shell Programming and Scripting | 2 | 11-21-2006 06:47 AM |
| simple Unix commands | i don't care | UNIX for Dummies Questions & Answers | 2 | 08-16-2002 11:09 AM |
| simple commands | aningsabah | UNIX for Dummies Questions & Answers | 1 | 10-19-2001 09:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
1. Start with "#!/bin/sh" or whatever shell you want to use.
2. Put whatever commands you want in the script. Which are the same as what you can type at the command line. 3. make it executable with chmod +x 4. "man sh" is the ultimate resource Which is rather like saying to play the flute you blow at one end and move your fingers over the holes. Code:
#!/bin/sh
# that comment is picked up by exec() and causes this script to be run by /bin/sh
echo this is a script
for d in a b c
do
echo $d
done
|
|
|||||
|
Some links ...
Shell Scripting Tutorial (Beginner-Intermediate) Bourne Shell Programming Advanced Bash-Scripting Guide BASH Programming - Introduction HOW-TO Jean-Pierre. |
|
||||
|
it is traditionally either
(a) a file with no extension, eg "foo" (b) a file with .sh as the extension, such as "foo.sh" (c) a file with the type of shell as the extension, eg "foo.ksh" It can live anywhere or on the PATH. You can say ./foo.sh or myfoo/foo.sh etc. To make it executeable use "chmod +x foo.sh" to change the executable rights. |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|