Sample Header Ad - 728x90

syntax error on case statement after ssh session

1 vote
2 answers
602 views
#!/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 I'm writing a script that start a ssh session and then perform some modifications on remote machine, it will give syntax error as follow:
bash: line 3: syntax error near unexpected token `)'
bash: line 3: `        1)'
Asked by TensorFlowGuan (51 rep)
Dec 23, 2020, 07:35 AM
Last activity: Dec 23, 2020, 09:14 AM