zsh-users
 help / color / mirror / code / Atom feed
From: Francisco Borges <f.borges@rug.nl>
To: Zsh User <zsh-users@sunsite.dk>
Subject: Re: [zsh] Re: cd - and $OLDPWD, bug in the manual?
Date: Sun, 26 Mar 2006 19:07:57 +0200	[thread overview]
Message-ID: <20060326170757.GA14054@let.rug.nl> (raw)
In-Reply-To: <060325233643.ZM6802@torch.brasslantern.com>

» On Sat, Mar 25, 2006 at 11:36PM -0800, Bart Schaefer wrote:

> The manual also says (note "Set" not "Used" here):
>
> Parameters Set By The Shell
>
> OLDPWD
>      The previous working directory.  This is set when the shell
>      initializes and whenever the directory changes.

Indeed I didn't read the OLDPWD entry. Thanks for pointing it out.

> The manual DOESN'T say that you can have any useful effect by
> assigning OLDPWD.  You can assign to PWD as well, but that doesn't
> cause a "cd" to magically occur.

I don't expect anything, except for the prompt, to automatically change
after an "export" without issuing any other command. (Whether that's
actually the case is beyond the point here.) I didn't expect this for
PWD nor for OLDPWD.

But I did expect "cd -" to change to the value of OLDPWD.

How did I come up with such a crazy, nonsensical idea?

By reading the manual, which *explicitly* states that this would
happen. No more, no less.

> The doc for "cd" could be marginally clearer if it said e.g. ...
>
>     If arg is `-', change to the previous directory, normally the value
>     of $OLDPWD.
>
> ... but would that have helped you?

Honestly, I'm sure it would.

Because it was the particular wording at the "cd" entry that got me into
trying to use the *value* of OLDPWD to influence "cd -".

IMHO this is not the case of being "marginally clearer" but about being
"technically accurate".

Regards,
Francisco


  reply	other threads:[~2006-03-26 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-23 21:08 Francisco Borges
2006-03-26  7:36 ` Bart Schaefer
2006-03-26 17:07   ` Francisco Borges [this message]
2006-03-26 18:40   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060326170757.GA14054@let.rug.nl \
    --to=f.borges@rug.nl \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).