Linux shell脚本中父子进程与变量的分析
【问题】一个 test.sh 里面这么写
#! /bin/bash
read test
echo $test
exit 0
保存, chmod +x test.sh
./test.sh
譬如输入 ok, 脚本就输出 ok
然后在 shell 下
直接 echo $test 却没有输出 ok...
这是怎么回事?这个自定义的变量不能同时使用么?
【分析】
问题的现象是在外部s
转载
2015-01-14 14:13:23 ·
2039 阅读 ·
0 评论