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