我有一个 chroot,我希望 chroot 在启动时有自己的.inputrc
文件,然后运行一个程序。
我习惯用 chroot 启动,chroot <PATH> <PROGRAM_TO_RUN>
所以我尝试了
chroot <PATH> bind -f <PATH_IN_CHROOT>/.inputrc && <PROGRAM_TO_RUN>
但后来我得到了错误:
chroot: failed to run command ‘bind’: No such file or directory
阅读readline
手册后,我看到bind
是bash
内置的。所以我尝试使用builtin
像这样运行命令:
chroot <PATH> builtin bind -f <PATH_IN_CHROOT>/.inputrc && <PROGRAM_TO_RUN>
但得到了同样的错误:
chroot: failed to run command ‘builtin’: No such file or directory
我知道通过 chroot 一起运行两个程序&&
,因为我测试过:
~# chroot <PATH> echo "yo" && echo "Hi"
yo
Hi
~#
我也知道bind
命令和builtin
命令在 chroot 中独立工作:
~# chroot <PATH> 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]
如何在命令中运行bind
命令,以便为 chrootchroot
设置自定义?.inputrc