UNIX Shell Script
出自KMU Wiki
目錄 |
Bourne shell(sh)
Variable
YOURVAR=some echo $YOURVAR echo ${YOURVAR}
Flow control
if [ -f your_file ]; then<br><br>echo "your_file exists"<br><br>fi<br>
for f in a b c<br>do<br> <br>echo $f<br><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> <br>echo $line<br><br>done<br>