简体   繁体   English

如何在Expect脚本中使用bash脚本的命令?

[英]how to use a command of a bash script in a expect script?

I have the following code, which is an expect script, I want to use mkdir to create a directory called input but I know that the command mkdir doesnt work in an expect script I would appreciate any help with this issue, I tried the folloging approach: 我有以下代码,这是一个期望脚本,我想使用mkdir创建一个名为input的目录,但我知道命令mkdir在期望脚本中不起作用,我将非常感谢此问题的帮助,我尝试了以下方法:

#!/usr/bin/expect
 expect "hello"
 send "world"
 mkdir input 

您不需要使用bash ,只需使用TCL的内置file mkdir命令:

file mkdir input

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM