UNIX Shell Script

出自KMU Wiki

(修訂版本間差異)
跳轉到: 導航, 搜索

Cch (對話 | 貢獻)
(新頁面: ==Bourne shell(sh)== === Variable === YOURVAR=some echo $YOURVAR echo ${YOURVAR} === Flow control === if [ -f your_file ]; then echo "your_file exists" fi for f in a b c ...)
下一個→

在2008年5月6日 (二) 19:14所做的修訂版本

目錄

Bourne shell(sh)

Variable

YOURVAR=some
echo $YOURVAR
echo ${YOURVAR}


Flow control

if [ -f your_file ]; then

echo "your_file exists"

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 
do

echo $line

done

C Shell