我有下面的代码,这是一个expect脚本, 我想要用mkdir创建一个名为输入 目录,但我知道,在一个 命令的mkdir不起作用想到剧本我很感激这个 问题的任何帮助,我试过folloging方法:如何在期望脚本中使用bash脚本的命令?
#!/usr/bin/expect
expect "hello"
send "world"
mkdir input
我有下面的代码,这是一个expect脚本, 我想要用mkdir创建一个名为输入 目录,但我知道,在一个 命令的mkdir不起作用想到剧本我很感激这个 问题的任何帮助,我试过folloging方法:如何在期望脚本中使用bash脚本的命令?
#!/usr/bin/expect
expect "hello"
send "world"
mkdir input
你并不需要使用bash
,只需使用TCL的内置file mkdir
命令:
file mkdir input
'Expect'是基于'TCL',它有一个'mkdir'函数:https:// www .tcl.tk/man/tcl8.4/TclCmd/file.htm#M22 – Barmar