当我运行以下代码时,我发现了这个错误
bash:/var/out.txt:没有这样的文件或目录
CREATE TEMPORARY TABLE "Tablename_20171024_115736_814_1"
AS SELECT "column1","column2","column3"
FROM "database"."schema"."table" WHERE FALSE
答案 0 :(得分:0)
Expect / Tcl不了解重定向(>
)char。试试这个:
spawn bash -c "ssh user@10.103.234.1 ls -t /var/backups/archives/ > /var/outp.log"
答案 1 :(得分:0)
使用tee替换 spawn ssh user@10.103.234.1'ls -t / var / backups / archives / | tee -a /var/outp.log'