[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Can someone explain this?
From: |
Jon Seymour |
Subject: |
Can someone explain this? |
Date: |
Sat, 12 Feb 2011 14:18:29 +1100 |
Can someone explain why this is happening?
#expected
$ bash -c 'cd /tmp; pwd'
/tmp
#expected
$ bash -c 'pwd; cd /tmp; pwd'
/home/jseymour
/tmp
#expected
$ ssh localhost bash -c 'pwd; cd /tmp; pwd'
/home/jseymour
/tmp
#unexpected
$ ssh localhost bash -c 'cd /tmp; pwd'
/home/jseymour
My expectation is that the last command should print:
/tmp
But, instead, the cd command seems to be completely ignored when bash
is run under ssh. I have reproduced this with bash 4.1.5 on Linux and
bash 3.0.0 on AIX.
jon.
- Can someone explain this?,
Jon Seymour <=
- Re: Can someone explain this?, Jon Seymour, 2011/02/11
- Re: Can someone explain this?, Dennis Williamson, 2011/02/11
- Re: Can someone explain this?, Jon Seymour, 2011/02/11
- Re: Can someone explain this?, Dennis Williamson, 2011/02/11
- Re: Can someone explain this?, Bob Proulx, 2011/02/12
- Re: Can someone explain this?, Jon Seymour, 2011/02/12
- Re: Can someone explain this?, Andreas Schwab, 2011/02/12
- Re: Can someone explain this?, Maarten Billemont, 2011/02/12