我有一個服務器列表的文件:GNOME終端選項卡中打開多個SSH連接
SERVERS.TXT:
192.168.0.100
192.168.0.101
192.168.0.102
從GNOME終端劇本,我想打開一個新的終端,具有每個服務器的選項卡。
這裏是我的嘗試:
gnome-terminal --profile=TabProfile `while read SERVER ; do echo "--tab -e 'ssh [email protected]$SERVER'"; done < SERVERS.TXT`
以下是錯誤:
Failed to parse arguments: Argument to "--command/-e" is not a valid command: Text ended before matching quote was found for '. (The text was ''ssh')
試過-e
gnome-terminal --profile=TabProfile `while read SERVER ; do echo "--tab -e'ssh [email protected]$SERVER'"; done < SERVERS.TXT`
後除去空間,我收到了類似的錯誤:
Failed to parse arguments: Argument to "--command/-e" is not a valid command: Text ended before matching quote was found for '. (The text was '[email protected]'')
顯然有一個解析錯誤,因爲外殼是試圖通過使用空間預測和地方分隔符的幫助。服務器文件如有更改,恕不另行通知,需要查看許多不同的服務器組。