关于shell type命令的一个疑问,请大家帮忙
- Python code
keegoo [ ~ ] :$ cat tmp.sh #!/bin/shecho `type -p svn`
- Python code
keegoo [ ~ ] :$ ./tmp.sh -p: not found svn is /usr/bin/svn
- Python code
keegoo [ ~ ] :$ . tmp.sh /usr/bin/svn
- Python code
keegoo [ ~ ] :$ sh -x tmp.sh + type -p svn+ echo -p: not found svn is /usr/bin/svn-p: not found svn is /usr/bin/svn
为什么在当前shell中(. tmp.sh)可以执行成功,而在子shell中(./tmp.sh)确执行失败?
谁能具体说说,谢谢大家!
[解决办法]
那就接分吧