bug-coreutils
[Top][All Lists]
Advanced

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

Re: back-forward functionality in 'cd'


From: Eric Blake
Subject: Re: back-forward functionality in 'cd'
Date: Wed, 24 May 2006 06:40:28 -0600
User-agent: Thunderbird 1.5.0.2 (Windows/20060308)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Arjun Shankar on 5/24/2006 6:30 AM:
> Hi!
> 
> Someone just handed me a nifty bit of shell script that works like
> 'cd', with the added advantage of being able to go back and forward
> ('cd ]' takes you forward, and 'cd [' takes you back to the last
> directory), just like text based file browsers (nautilus etc).
> Basically, It is something better than 'cd -'. Wouldn't it be a good
> idea to include it as an option in the actual 'cd'? I think such an
> option makes for much easier directory traversal.

Coreutils does not provide cd, so this is the wrong list to ask.  cd is
usually provided as a shell builtin.

> I believe POSIX does
> not allow this, and that you would like to stick with what you got
> already, but I guessed you would consider this, because it makes
> things a lot easier.

You nailed it - cd is specified by POSIX, and changing it as you proposed
would be a POSIX incompatibility, so I doubt you will be able to get bash,
ksh, zsh, or any other shell to change their implementation of cd.  It
might be possible to provide it as an extension, by using an new option to
cd (so you might type something like 'cd -f' to go forward); but even that
is unlikely, since the pushd and popd builtins of bash already have the
ability to traverse a directory stack, which sounds like the feature you
are asking for.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEdFQ884KuGfSFAYARAr4hAKDBB+48mhS4yMG5xKLHqVr/FwQDFQCguUGA
oF1cdMKu6ugacgQvwRwa0ZU=
=L2oo
-----END PGP SIGNATURE-----




reply via email to

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