I am trying to execute the script file sc.sh on remote machine user@remote-01 using ssh. I also need to pass the arguments while executing this ssh command. So that i have to use those arguments in sc.sh. This is my script which I am trying to execute
var1=True
var2=False
var3=True
sshpass -p 'pswd' ssh user@remote-01 "bash -s" < /home/user/sc.sh
My sc.sh looks like:
if var1 -eq True; then
echo "Todo"
fi
if var2 -eq True; then
echo "Todo"
fi
if var3 -eq True; then
echo "Todo"
fi
..... so on
How can i pass var1, var2, var3 as arguments and use them in my script as above?