Linux ';无效命令';expect脚本出错,在交互模式下可以正常运行

Linux ';无效命令';expect脚本出错,在交互模式下可以正常运行,linux,shell,Linux,Shell,我在运行expect脚本时遇到问题(这是一个非常新的脚本)。 下面是我现在在expect脚本autorun.exp中看到的内容: #!/usr/bin/expect -f cd /auto/rmscr/shared_resources/qiuyuguo/softwares/QuEST_2.4 ./generate_QuEST_parameters.pl -sam_align_ChIP A.sam -sam_align_RX_noIP \ B.sam -rp mm10_bychr -ap

我在运行expect脚本时遇到问题(这是一个非常新的脚本)。 下面是我现在在expect脚本
autorun.exp
中看到的内容:

#!/usr/bin/expect -f
cd /auto/rmscr/shared_resources/qiuyuguo/softwares/QuEST_2.4
./generate_QuEST_parameters.pl -sam_align_ChIP A.sam -sam_align_RX_noIP \
    B.sam -rp mm10_bychr -ap ./output_directory -ChIP_name name
运行此脚本后,我得到的是:

[qiuyuguo@hpc-uec 20150605]$ ./auto_run.exp
invalid command name "./generate_QuEST_parameters.pl"
    while executing
"./generate_QuEST_parameters.pl -sam_align_ChIP A.sam -s..."
    (file "./auto_run.exp" line 3)

有趣的是,脚本中的内容在expect的交互模式下运行良好。我可以得到一个关于发生了什么的提示吗?

expect脚本应该有一个
spawn
命令、一个
expect
命令和一个
send
命令

这是一个例子:

#!/usr/bin/env expect

spawn su -l test
expect "Password: " {
  send "xxxxx\r"
}
expect "# " {
  send "exit\r"
}
expect eof {
  exit
}

你可以编辑你的文章以使它正确。这个脚本的目的是自动运行一个脚本,它需要在程序运行的中间输入参数。如果有更简单的替代方法,也会很有帮助。您的脚本看起来不像
Expect
脚本。尝试使用
sh auto\u run.exp运行它。