bug-bash
[Top][All Lists]
Advanced

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

Re: cd with two arguments


From: Chet Ramey
Subject: Re: cd with two arguments
Date: Mon, 14 May 2001 10:32:45 -0400

> I used to use some Motorola SystemV machine with ksh some time ago that
> accepted two arguments to cd, like
> 
> address@hidden:~/src/kdelibs/arts/mcop$ cd src build
> address@hidden:~/build/kdelibs/arts/mcop$
> 
> that is, if you give two arguments, then cd
>  - takes the current path
>  - searches for the first argument
>  - replaces it by the second argument
>  - cd's into that path
> 
> I think that this behaviour sometimes has a convenient effect, and if you
> don't know about it, it shouldn't hurt you. Bash (2.05) doesn't do that.
> Could that be included in bash in the future? I could try to make a patch,
> if you like.

It's trivial to do with a shell function.  Look at
examples/functions/ksh-cd in the bash-2.05 distribution.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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