Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to execute (from windows) a local script with arguments on a remote linux system?

Here's what I got:

plink -l root -pw mypassword -m

Is there a way to do this same thing, but able to give input parameters to

I've tried many things, including:

plink -l root -pw mypassword -m input1 input2

In this case it seems that plink thinks that input1 and input2 are its arguments.. which makes sense.

What are my options?

share|improve this question

plink does not run the script as a sh script; it just sends its contents as separate commands, so there is nothing you could pass arguments to.

You could get around this by telling the shell to interpret its stdin as if it was a file:

plink -T ... $SHELL /dev/stdin arg1 arg2 arg3 <
share|improve this answer
Does not work for me. Am I supposed to replace '$SHELL' with something? is arg1 supposed to be the name of the file? I've tried all kinds of combinations, nothing seems to work. My looks like this: '#!/bin/bash echo "Your argument is "$1'. – c_maker Nov 17 '11 at 0:01
@c_maker: Try the updated version; and no, $SHELL will be automatically expanded on the server, and arg1 is the first argument you want to give. – grawity Nov 17 '11 at 0:58

I had the same issue.

You can simply write this line

plink -l root -pw pass " arg1 arg2"

For example, I had to run a script and give two files as parameters.

plink -l root -pw pass " path/to/file1 path/to/file2"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.