How can I execute local script on remote machine and include arguments?
177
votes
5
answers
307856
views
I have written a script that runs fine when executed locally:
./sysMole -time Aug 18 18
The arguments **"-time"**, **"Aug"**, **"18"**, and **"18"** are successfully passed on to the script.
Now, this script is designed to be executed on a remote machine but, from a local directory on the local machine. Example:
ssh root@remoteServer "bash -s" < /var/www/html/ops1/sysMole
That also works fine. But the problem arises when I try to include those aforementioned arguments **(-time Aug 18 18)**, for example:
ssh root@remoteServer "bash -s" < /var/www/html/ops1/sysMole -time Aug 18 18
After running that script I get the following error:
bash: cannot set terminal process group (-1): Invalid argument
bash: no job control in this shell
Please tell me what I'm doing wrong, this greatly frustrating.
Asked by AllenD
(2507 rep)
Aug 20, 2013, 01:52 AM
Last activity: Jun 22, 2025, 07:27 PM
Last activity: Jun 22, 2025, 07:27 PM