当前位置: 技术问答>linux和unix
请教一个exec的问题
来源: 互联网 发布时间:2016-05-24
本文导语: 两个shell脚本,其中 test1: #!/bin/sh exec /root/test2 test2: #!/bin/sh echo "hello" 运行./test1时,报错 : bad interpreter: No such file or directory ./test1: line 2: /root/test2: Success 如果把test2中的#!/bin/sh这行去掉,就可以打出"hello",...
两个shell脚本,其中
test1:
#!/bin/sh
exec /root/test2
test2:
#!/bin/sh
echo "hello"
运行./test1时,报错
: bad interpreter: No such file or directory
./test1: line 2: /root/test2: Success
如果把test2中的#!/bin/sh这行去掉,就可以打出"hello",好像错误信息里的No such file or directory这句是指/bin/sh这个文件,可是这个文件明明存在啊,百思不得其解,谁能告诉我是怎么回事儿呢?感激不尽。我的系统是Red Hat Enterprise Linux 3
test1:
#!/bin/sh
exec /root/test2
test2:
#!/bin/sh
echo "hello"
运行./test1时,报错
: bad interpreter: No such file or directory
./test1: line 2: /root/test2: Success
如果把test2中的#!/bin/sh这行去掉,就可以打出"hello",好像错误信息里的No such file or directory这句是指/bin/sh这个文件,可是这个文件明明存在啊,百思不得其解,谁能告诉我是怎么回事儿呢?感激不尽。我的系统是Red Hat Enterprise Linux 3
|
red hat用的是bash吧.
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。