User Tools

Site Tools


unix_survival

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
unix_survival [2020/04/08 23:09]
joshd
unix_survival [2020/04/08 23:16] (current)
joshd
Line 152: Line 152:
 ** Shell Programming ** ** Shell Programming **
  
-The shell itself is programmable via /shell scripts/​. ​ As with C, a complete tutorial is beyond the scope of this page but we'll provide a few examples to get you started. ​ The below examples are for // /bin/sh//, the //Bourne shell//, as this is available on all online UNIX systems. ​ Other common shells are //ksh, csh, tcsh, and bash//.+The shell itself is programmable via /shell scripts/.  A shell script can invoke any of the standard UNIX tools as well as other shell scripts, and can make use of control constructs, including loops and comparisons.  As with C, a complete tutorial is beyond the scope of this page but we'll provide a few examples to get you started. ​ The below examples are for // /bin/sh//, the //Bourne shell//, as this is available on all online UNIX systems. ​ Other common shells are //ksh, csh, tcsh, and bash//.
  
 As with the C examples above, we'll use //ed// to create our source files. ​ (Short shell scripting can also be done interactively at the command line.) As with the C examples above, we'll use //ed// to create our source files. ​ (Short shell scripting can also be done interactively at the command line.)
Line 168: Line 168:
 </​code>​ </​code>​
  
-The first line (//#​!/​bin/​sh) is sometimes referred to as the "​shebang"​ line (because UNIX programmers are weird) and tells the operating system what shell to invoke to execute the script file.+The first line (//#​!/​bin/​sh//) is sometimes referred to as the "​shebang"​ line (because UNIX programmers are weird) and tells the operating system what shell to invoke to execute the script file -- in this case the Bourne shell, in /bin/sh. 
 Now we've created the script, and there it is on disk: Now we've created the script, and there it is on disk:
  
unix_survival.txt · Last modified: 2020/04/08 23:16 by joshd