#!/bin/sh
echo -n "Enter the raspberry ip address you want to connect:"
read Rasp_id
sshpass -p "the@Donut" ssh -t -X -oStrictHostKeyChecking=no pi@$Rasp_id << E2
echo -e "Enter the case you want to echo\n 1.1 a \n 2.1 b"
read option
case "\$option" in
1)
echo "a"
;;
2)
echo "b"
;;
esac
E2
Run Code Online (Sandbox Code Playgroud)
我正在编写一个启动 ssh 会话然后在远程机器上执行一些修改的脚本,它会给出如下语法错误:
bash: line 3: syntax error near unexpected token `)'
bash: line 3: ` 1)'
Run Code Online (Sandbox Code Playgroud)