Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • If the answer solves your problem, you should consider ^ (upvoting) and tick-mark (accepting) the answer. Judging from your questions history, you have not accepted answers to any of your previous questions Commented Sep 6, 2019 at 3:45
  • Why don't you let the remote shell script read the values? Why do you need to first read them, then pass them over ssh, parse them and then use them? Commented Sep 6, 2019 at 6:27
  • @Kusalananda i tried that but when like below ssh -i my.pem -p 2022 ec2-user@ip-address 'bash -s' << EOF echo "input $variable" for i in $(echo ${variable} | sed "s/,/ /g") do echo "$i" done EOF Commented Sep 6, 2019 at 6:35
  • Is there any reason why you can't write a script that you execute completely on the remote side of the ssh connection, as in ssh -i ... ./myscript.sh? Commented Sep 6, 2019 at 6:42
  • yes i want only one script should perform this action without using any another script Commented Sep 6, 2019 at 6:43