小编Jam*_*mer的帖子

为什么 $0 设置为 -bash?

第一个登录进程名称似乎设置为-bash,但是如果我使用 subshel​​l 则它变为bash. 例如:

root@nowere:~# echo $0
-bash
root@nowere:~# bash
root@nowere:~# echo $0
bash
Run Code Online (Sandbox Code Playgroud)

-bash 导致某些脚本失败,例如 . /usr/share/debconf/confmodule

root@nowere:~# echo $0
-bash
root@nowere:~# bash
root@nowere:~# echo $0
bash
Run Code Online (Sandbox Code Playgroud)

有谁知道为什么$0设置为-bash

command-line bash scripts debconf

8
推荐指数
1
解决办法
3696
查看次数

标签 统计

bash ×1

command-line ×1

debconf ×1

scripts ×1