Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何在交互式环境中使用bash命令?_Linux_Bash - Fatal编程技术网

Linux 如何在交互式环境中使用bash命令?

Linux 如何在交互式环境中使用bash命令?,linux,bash,Linux,Bash,如问题所述,我在交互环境中使用多个命令时遇到问题。例如,我正在编译内核,并键入以下命令: bash此错误表示当前shell无法找到命令bash bash: line 3: 0: command not found 因此,要么使用不同的shell,要么正确设置路径,使其解析为/bin/bash,而不仅仅是bash。这可以为您解决问题: /bin/bash << fin make nconfig # this is an interactive command xdotool ke

如问题所述,我在交互环境中使用多个命令时遇到问题。例如,我正在编译内核,并键入以下命令:


bash此错误表示当前shell无法找到命令
bash

bash: line 3: 0: command not found
因此,要么使用不同的shell,要么正确设置路径,使其解析为
/bin/bash
,而不仅仅是
bash
。这可以为您解决问题:

/bin/bash << fin
make nconfig   # this is an interactive command
xdotool key F9  # this simulate a keystroke
xdotool key Return # this simulate a keystroke
xdotool key Return # this simulate a keystroke
fin

/bin/bash发布的代码是否足以重现问题?抱歉,没有,完整代码是:#/bin/bash回应“这里有一些注释”,bash认为代码也不足以重现问题。错误消息说,
bash
找不到名为
0
的命令。在您的真实代码中,哪里有错置的零?但如果是这样,那么您肯定看到了关于
fin
的错误消息。