UNIX Shell Script
出自KMU Wiki
目錄 |
Bourne shell(sh)
Variable
YOURVAR=some<br>echo $YOURVAR<br>echo ${YOURVAR}<br>
Flow control
if [ -f your_file ]; then<br> echo "your_file exists"<br> fi<br>
for f in a b c<br>do<br> echo $f<br> done<br>
Sub Program
sub()<br>{<br> echo $1 $2 $3<br>}sub X Y Z<br>
Examples
#!/bin/sh <br>exec < $1<br>while read line <br>do<br> echo $line<br> done<br>