4

我有这样的命令:

sftp user@host <<EOF
put file.txt
exit
EOF

现在我想将它的输出通过管道传输到zenity --progress,但我找不到放置它的地方。

# SFTP doesn't work anymore
sftp user@host | zenity --progress <<EOF
put file.txt
exit
EOF

# Invalid syntax, no end of heredoc
sftp user@host <<EOF
put file.txt
exit
EOF | zenity --progress

# Not picked as part of the command
sftp user@host <<EOF
put file.txt
exit
EOF
| zenity --progress

# Does not help
sftp user@host | zenity --progress <<EOF
put file.txt
exit
EOF\
| zenity --progress 
4

1 回答 1

11

这应该可以解决问题:

sftp user@host <<EOF | zenity --progress
...
EOF
于 2012-06-05T09:19:10.673 回答