我有一个chroot,我希望chroot在启动时拥有自己的.inputrc文件,然后运行一个程序。
我习惯于用chroot 启动色度,所以我试了一下
chroot bind -f /.inputrc && 但是我得到了一个错误:
chroot: failed to run command ‘bind’: No such file or directory在阅读了readline手册之后,我看到bind是一个bash内置的。因此,我尝试使用builtin来运行如下命令:
chroot builtin bind -f /.inputrc && 但也有同样的错误:
chroot: failed to run command ‘builtin’: No such file or directory我知道通过&&一起运行两个程序是针对chroot的,因为我用:
~# chroot echo "yo" && echo "Hi"
yo
Hi
~#我还知道,bind命令和builtin命令在chroot内部独立工作:
~# chroot bash
/# builtin -h
bash: builtin: -h: invalid option
builtin: usage: builtin [shell-builtin [arg ...]]
/# builtin bind -h
bash: bind: -h: invalid option
bind: usage: bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]
/# bind -h
bash: bind: -h: invalid option
bind: usage: bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]How我可以在 chroot command中运行 .inputrc command,这样我就可以设置一个自定义D17 for -- chroot?
发布于 2020-03-04 21:17:18
只是猜测一下:
您正试图在chroot中运行一个Bash内置命令,如下所示:
chroot bind -f /.inputrc && 但是您的chroot没有任何解释器运行,可以理解bind。做了以下工作:
chroot bash -c "bind -f /.inputrc && "正如@mosvy所说的,首先作为回答,然后作为注释,您可以使用chroot调用传递环境:
INPUTRC=/path/to/inputrc chroot bash https://unix.stackexchange.com/questions/571155
复制相似问题