[Top][All Lists]

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

Re: BASH bug CDPATH plus redirection

From: Tim Mooney
Subject: Re: BASH bug CDPATH plus redirection
Date: 28 Jun 2001 00:56:31 GMT

In article <address@hidden>, 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

I suggest you set your CDPATH variable in your .profile or .bash_profile,
and not export it.  That way you have it for interactive use, but it
won't get in the way of scripts, etc.

> Redirections should be allowed both before and after a
> command. i.e.
> </etc/passwd cat
> Ok, that works, but...
> </etc/passwd (cat)
> Fails, which is wrong. In other words, when you run a
> sub-shell with the "(...)" syntax, it should still allow
> redirections at the beginning. That allows you to more
> easily convert the expression in Problem #1 to use temp
> files...
> (cd dir1 ; tar cf - foo ) >foo.tar ; <foo.tar (cd dir2 ; tar xf - )
> BTW, ash does this correctly, bash does not.

;-) If there's an area where "ash" is more "correct" than bash, I've not
seen it.

Instead of doing the redirection you're trying, you might be able to get
away with using a fifo as the intermediate filesystem object to hold the
data.  That way you shouldn't need to fool around with redirection at all.
Of course, redirecting the output from cd might be just as easy.

Tim Mooney                              address@hidden
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

reply via email to

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