bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can someone explain this?


From: Dennis Williamson
Subject: Re: Can someone explain this?
Date: Fri, 11 Feb 2011 21:44:28 -0600

On Fri, Feb 11, 2011 at 9:21 PM, Jon Seymour <address@hidden> wrote:
> Correction - a _leading_ cd command and only a leading cd command,
> seems to be completely ignored in the case I described.
>
> Why is this?
>
> jon.
>
> ---------- Forwarded message ----------
> From: Jon Seymour <address@hidden>
> Date: Sat, Feb 12, 2011 at 2:18 PM
> Subject: Can someone explain this?
> To: address@hidden
>
>
> 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.
>
>

It's not particular to Bash. I can reproduce it in several other shells.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]