1

about shell variables and environment variables

view story
linux-howto

http://stackoverflow.com – I'm reading Wrox, Beginning Linux Programming. But I've got a question about shell variables. Here is a shell script named test.sh: #! /bin/bash read test echo $test exit 0 Then I chmod the script: $ chmod +x test.sh $ ./test,sh When I type "ok", it echos the "ok". But when I returned to the shell interface, I typed: $ echo $test It returned nothing... I don't know why $test doesn't return "ok" just like the script does... And the book doesn't metion it... Thanks in advance:) (HowTos)