bash cat 一个文件从另一个服务器到一个变量
bash cat a file from a another server to a variable
我正在尝试对变量执行 cat 的基本命令,但它不起作用..
lines="not working"
sshpass -p triltest ssh root@ILCFS 'cat /var/try/check ' > $lines
echo $lines
./script.sh: line 34: $lines: ambiguous redirect
not working
文件存在。谁能帮帮我?
使用`command`
或$(command)
。 IE。
lines=$(sshpass -p triltest ssh root@ILCFS 'cat /var/try/check ')
echo "$lines"
我正在尝试对变量执行 cat 的基本命令,但它不起作用..
lines="not working"
sshpass -p triltest ssh root@ILCFS 'cat /var/try/check ' > $lines
echo $lines
./script.sh: line 34: $lines: ambiguous redirect
not working
文件存在。谁能帮帮我?
使用`command`
或$(command)
。 IE。
lines=$(sshpass -p triltest ssh root@ILCFS 'cat /var/try/check ')
echo "$lines"