bug-bash
[Top][All Lists]
Advanced

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

Re: BASH bug CDPATH plus redirection


From: Sven Mascheck
Subject: Re: BASH bug CDPATH plus redirection
Date: 27 Jun 2001 18:15:02 +0200
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))

Chris <address@hidden> wrote:

> In a shell script the "cd" command echos the directory when
> the CDPATH is set. So for example, the command for copying
> directories

ksh93 and the POSIX shell on Solaris behave the same.
It seems to be required by SUSV2, as it does not distinguish
between non-/interactive.
<http://www.unix-systems.org/single_unix_specification_v2/xcu/cd.html>

bash might perhaps disable it when not being in POSIX mode?

> (cd dir1 ; tar cf - foo ) | (cd dir2 ; tar xf - )
> will fail, because the first cd command will echo the
> new directory thus corrupting the tar archive.

What about redirecting STDOUT of cd to /dev/null.
Possible errors don't get lost, as they get to STDERR
--but then tar might be your biggest problem, anyway :)

Sven



reply via email to

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