bash builtin command exec 的man手册有一句不甚求解
来源:学生作业帮 编辑:作业帮 分类:数学作业 时间:2024/05/24 08:41:22
bash builtin command exec 的man手册有一句不甚求解
If -a is supplied,the shell passes name as the zeroth argument to the executed command.
说不清楚给想关背景也可以,或是给个例子.
If -a is supplied,the shell passes name as the zeroth argument to the executed command.
说不清楚给想关背景也可以,或是给个例子.
如果你在exec后添加-a选项,则该选项后面的name参数 将作为位置参数$0的值,本来$0的值为当前进程所对应的命令的名字.
我给你一例 对比之,以我的名字 ranpanf作为 -a的name参数.
ranpanf@ranpanf-laptop:~$ exec -a ranpanf bash
ranpanf@ranpanf-laptop:~$ echo $0
ranpanf
ranpanf@ranpanf-laptop:~$
看到了吗?
如果不加-a选项的话
ranpanf@ranpanf-laptop:~$ exec bash
ranpanf@ranpanf-laptop:~$ echo $0
bash
ranpanf@ranpanf-laptop:~$
这就是区别
再问: 那这个又怎样解释? test.sh: #!/bin/bash echo $0 read aa #prompt for refusing to exit immediately #end test.sh xiong@xiong-desktop:~/tmp$ exec -a foo ./test.sh /home/xiong/tmp/test.sh 还有 这个有用处吗?
再答: 这个我还真看不出有什么作用 呵呵
我给你一例 对比之,以我的名字 ranpanf作为 -a的name参数.
ranpanf@ranpanf-laptop:~$ exec -a ranpanf bash
ranpanf@ranpanf-laptop:~$ echo $0
ranpanf
ranpanf@ranpanf-laptop:~$
看到了吗?
如果不加-a选项的话
ranpanf@ranpanf-laptop:~$ exec bash
ranpanf@ranpanf-laptop:~$ echo $0
bash
ranpanf@ranpanf-laptop:~$
这就是区别
再问: 那这个又怎样解释? test.sh: #!/bin/bash echo $0 read aa #prompt for refusing to exit immediately #end test.sh xiong@xiong-desktop:~/tmp$ exec -a foo ./test.sh /home/xiong/tmp/test.sh 还有 这个有用处吗?
再答: 这个我还真看不出有什么作用 呵呵
有一道智力题不甚了然求解
dictate command order的区别
不甚了然的甚是什么意思
a good command of Grammar 的意思
demand,command,request,require的细致区别?
Linux红帽shell编程,在bin目录解析器用到sh和bash,显示脚本用到sh+ 文件名.那bash的咋看 .
简述bash shell命令行替换中单引号、双引号、倒引号的区别,以$PATH为例
英语翻译baby bash 的 obession[00:15.80]Its early in the morning[0
be in command 和be in command of的意思与区别,
I have a fair command of Japanese 其中的fair 和 command是什么意思?
天上的街市中的不甚是什么意思
Thank you!CC = g++EXEC = emisOBJS = main.o all:$(EXEC)$(EXEC