GIÁO TRÌNH UNIX - Trang 51

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

50

10.3.2 Thöïc hieän moät shell_script trong shell cha:
Thöïc hieän moät shell_script trong shell cha cho pheùp noù thöøa keá söû duïng toaøn boä moâi
tröôøng cuûa shell cha:

Thí duï:

$

cat proc

echo $var


$VAR= ok

ñònh nghóa bieán var trong shell


$

proc

moät shell con ñöôïc taïo ra vaø noù khoâng hieåu bieán VAR

$.proc

shell töï thöïc hieän leänh maø khoâng taïo shell con, bieán VAR
coù trong moâi tröôøng cuûa noù.