Subject: csh pushd
To: None <tech-userlevel@netbsd.org>
From: Jan Schaumann <jschauma@netmeister.org>
List: tech-userlevel
Date: 04/17/2004 13:06:38
--V0207lvV8h4k8FAm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

I just noticed two problems in the csh's popd behaviour:

The manual page says

           pushd
           pushd name
           pushd n

	With a numeric argument, pushd rotates the n'th argument of
	the directory stack around to be the top element and
	changes to it.

This is not quite accurate.  The correct syntax is 'pushd +n'.
Secondly, if n is 0, csh treats it as a director name.  Even though
'pushd +0' is a no-op, I believe it should not try to interpret '+0' as
a directory.  Especially, since directories named '+n' (for n !=3D 0) need
to be escaped if they are to be used as names rather than number.  (Ie
to push the directory named '+1' on the stack, you'd have to do 'pushd
\+1' - the same should hold for '+0')

Am I correct with this?

-Jan

--=20
If you are undertaking anything substantial, C is the only reasonable choice
of programming language.
	-- UNIX User's Supplementary Documents

--V0207lvV8h4k8FAm
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAgWQefFtkr68iakwRAnbeAJ9mfxs4vZ9YsqXySpCLf0Z/xW4Q+ACdHYb5
Re8jbq10BGwgVjpWuVitGA8=
=wsNo
-----END PGP SIGNATURE-----

--V0207lvV8h4k8FAm--