:~$ $HOME/bin/args 'ulimit -a'
1 args: 'ulimit -a'
imadev:~$ remsh localhost $HOME/bin/args 'ulimit -a'
2 args: 'ulimit' '-a'
imadev:~$ ssh localhost $HOME/bin/args 'ulimit -a'
wool...@localhost's password:
2 args: 'ulimit' '-a'
Nice! It would also be illustrative to show what happens without
peter360 peter...@fastmail.us writes:
In my case, I just got
$ ssh localhost bash -x -c 'ulimit -a'
unlimited
+ ulimit
Try ssh -v as Marc wrote.
debug1: Sending command: bash -x -c ulimit -a
The quotes are lost at this point.
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key
peter360 peter...@fastmail.us writes:
That makes sense. So the feature is to split all parameters on space even
if they are quoted?
The feature is that ssh concatenates all remaining arguments to a single
string and passes that to the shell on the remote side. If you want to
preserve any
compatibility with remsh/rsh.
imadev:~$ $HOME/bin/args 'ulimit -a'
1 args: 'ulimit -a'
imadev:~$ remsh localhost $HOME/bin/args 'ulimit -a'
2 args: 'ulimit' '-a'
imadev:~$ ssh localhost $HOME/bin/args 'ulimit -a'
wool...@localhost's password:
2 args: 'ulimit' '-a'
--
View this message
bash -x -c 'ulimit -a'
(And as usual, check out the Guide to unix shell quoting)
--
View this message in context:
http://www.nabble.com/ulimit-and-ssh--tp25262471p25530174.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.
peter360 a écrit :
Thanks for the explanation. So my understanding of the way ssh works is
still incorrect. I am confused about at which point the two parameters,
-c and ulimit -a were converted into three, -c, ulimit, and -a. I
guess I need to read the source of ssh and bash to really
,
No. It isn't put into one string unless you quote it as one string.
--
View this message in context:
http://www.nabble.com/ulimit-and-ssh--tp25262471p25351813.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.
the source of ssh and bash to really understand this...
It's an ssh feature for backward compatibility with remsh/rsh.
imadev:~$ $HOME/bin/args 'ulimit -a'
1 args: 'ulimit -a'
imadev:~$ remsh localhost $HOME/bin/args 'ulimit -a'
2 args: 'ulimit' '-a'
imadev:~$ ssh localhost $HOME/bin/args 'ulimit
Can someone explain this to me? Why am I not seeing correct results from
ulimit after ssh into localhost? Thanks!
$ ssh localhost bash -c 'ulimit -a'
unlimited
but
$ bash -c 'ulimit -a'
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority
peter360 wrote:
Can someone explain this to me? Why am I not seeing correct results from
ulimit after ssh into localhost? Thanks!
$ ssh localhost bash -c 'ulimit -a'
unlimited
You have insufficiently quoted your argument to ssh. This is causing
bash not to get ulimit -a but to get ulimit
ulimit after ssh into localhost? Thanks!
$ ssh localhost bash -c 'ulimit -a'
unlimited
You have insufficiently quoted your argument to ssh. This is causing
bash not to get ulimit -a but to get ulimit -a instead. You are
seeing the output of ulimit.
Try this:
ssh localhost bash -c
with rsh/ssh) parses the arguments /again/. Which means you
almost always need two layers of quoting if quoting is needed. One
for the local shell. One more for the remote shell.
echo ulimit -a | ssh localhost bash
This style avoids the quoting problem entirely and guarentees that the
remote
12 matches
Mail list logo