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.

3
  • also tried that. did not work Commented Sep 6, 2017 at 11:26
  • @oakley00 You should use $1 in the script that executes remotely (instead of $varA). That ought to work. If not, update the text in the question with information about what "doesn't work". Commented Sep 6, 2017 at 11:27
  • 1
    Note that the content of $varA will be passed as the first argument to scriptb.sh only if it contains none of the special characters of the login shell of the user on the remote host. For instance, if $varA contained $(reboot) (quite unusual for a hostname) and the login shell of the user was POSIX-like, that would cause reboot to be called instead. Commented Sep 6, 2017 at 11:48