N
N
Nubik2018-09-29 12:50:16
bash
Nubik, 2018-09-29 12:50:16

How to pass a variable to the server?

Hello.
Script:

echo "Enter IP: $S"
read S
printf "CHECK BLOCK IP: $S " 
echo
ssh -tt [email protected]	 /bin/bash << 'EOT'
iptables-save | grep  | grep $S
exit
EOT
read -p "Press enter to continue!!!!"
echo "SUCCESS!!!"

And the server reads the command directly from the variable without substituting the IP.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nubik, 2018-09-29
@nubiks

You just had to remove the quotes 'EOT'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question