2015-10-17 55 views
-1

正如问题所述,我在使用交互式环境中的几个命令时遇到了问题。例如,我在编译内核,我键入以下命令:如何在交互式环境中使用bash命令?

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 

它的工作原理,但我为什么我总是得到这样的stderror躁动:

bash: line 3: 0: command not found 

(其中,3号线= bash << fin

+0

是发表的代码足以重现该问题? –

+0

对不起,完整的代码是:#!/ bin/bash echo“这里有一些注释”bash << fin make nconfig#这是一个交互命令 xdotool key F9#模拟键盘 xdotool key返回#这模拟了一个按键 xdotool key返回#这个模拟一个按键 fin回声“其他人在这里评论” – shaveax

+0

该代码是不够重现的问题。错误消息说'bash'找不到命名为'0'的命令。在你的真实代码中__,你有没有错位的零点? – John1024

回答

1

这个错误表示,当前的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 
+0

谢谢多数民众赞成在工作:) – shaveax

+0

但如果是这样的话,那么你一定看到了关于'fin'的错误消息。 –

相关问题