bug-bash
[Top][All Lists]
Advanced

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

Re: cd /xxx && rm *


From: Chet Ramey
Subject: Re: cd /xxx && rm *
Date: Mon, 19 Jul 2004 15:28:15 -0400

> I found that sh and ksh return 1 on bad  cd, but bash returns 0.
> So bash : cd /xxx && rm *   - will remove everything in your current

Not true.

caleb.INS.CWRU.Edu(1)$ cd /xxx
-bash: cd: /xxx: No such file or directory
caleb.INS.CWRU.Edu(1)$ echo $?
1

You probably have a shell function for cd that returns success
unconditionally.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

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