GIÁO TRÌNH UNIX - Trang 36

Copyright(c) by Galaxy CD – http://www.galaxycd.com

35

$

sh

-x

proc

Thí duï:

-

duøng “-x”:

$

cat exam1

set

-x

echo “The current directory is :”
pwd
echo “List of files :“
echo file1 file2 file3


$

exam1

+ echo The current directory is :
The current directory is:
+ pwd
/users/user8
+ echo List of files:
List of files:
+ echo file1 file2 file3
file1 file2 file3

-

duøng “-v”:

$

cat exam2

set

-v

echo “The current directory is :”
pwd
echo “List of files :“
echo file1 file2 file3

$

exam2

echo The current directory is :
The current directory is:
pwd
/users/user8
echo List of files:
List of files:
echo file1 file2 file3
file1 file2 file3

Coù theå duøng kyù töï ‘#’ ñeå vieát chuù thích cho doøng leänh trong shell_script, neáu chuù thích
vieát ngay sau leänh treân cuøng moät doøng, ta phaûi cho ít nhaát moät daáu caùch (space) vaøo
tröôùc kyù töï ‘#’.