Passing SSH Command Parameters

Hi,

I wan to pass arguments to remote script in Unix .

For that I'm using ssh

PFB the code I'm using:

ssh -t -l osdac 10.81.33.51 "cd /appl/OSD/LOGS/flstr010/test.sh "$1" "$2""

Problem is I'm not able to pass second argument .

Can anyone plz help me in resolving this.

I am wondering if you can pass arguments to scripts executed via ssh

$ cat getipline.sh | ssh root@micky /bin/sh

As far my understanding it should not allow passing command line args to the script executed via ssh. I might be wrong too.

//Jadu

HI,
Thanks Jadu.
i can able to pass parameters in one server but if m trying same for another then its failing either its asking for password or its not passing both argument(both of these servers are different).

Suchita

If it's asking for password, maybe the public key of the machine you are using to ssh from is not in the authorzized_keys on the target user@host's authorized_keys.

Btw the syntax is wrong - you can't cd into a skript, only into a directory.

For the other machine not accepting the 2nd parameters, can you please post the command and output of the error here?

Thanks.

sorry code is ssh -t -l osdac 10.81.33.51 "/appl/OSD/LOGS/flstr010/test.sh "$1" "$2""

I'd made that entries now its not asking for password ...bt its not taking 2nd parameter. :frowning:

-- suchita

What about:

ssh -t -l osdac 10.81.33.51 /appl/OSD/LOGS/flstr010/test.sh "$1" "$2"