From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6643 invoked by alias); 21 Sep 2010 15:48:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28283 Received: (qmail 2481 invoked from network); 21 Sep 2010 15:48:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=M+mciiFm6EoMuEMtdRbSuIf+QTn9QOqGMrKlxBysDiQ=; b=GyUV6ICBVLM58i2mTy7kMOisZhp+/it0zdXrrEUjJ8kYXr+LQEK6xug++bnAMiH7nD KCs9rJGkEK5eK1rO8fSEuNnss/UaaoRFC1yxz9wCPq5TNOdlj3YWn2BHiRRQvhd3eNsL 4/uZBJz6P2ebUR6272NY13RJLC8sYBKFfgZG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Jgt1YDxSere8PW3aHRqs+5L93mk3rNWroHJXsjZgI/vaeK5lGZPZT1ujtlqoGtHf4p JpvAjgxo6fFuBhGG2ij29KGLNoHza27B2l+Ju3kQMqVx5fCIt9sQD1tPSmY5kJc9FM17 Sr1s2dyPC+0uadWXF4IURGPlOfQOh8bUgdymY= MIME-Version: 1.0 Date: Tue, 21 Sep 2010 17:48:41 +0200 Message-ID: Subject: $PWD and ~+ (and others) in documentation From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 Hi, I noticed that PWD can be assigned to, and found a thread from 98 where it was discussed a bit. Apparently some scripts like to assign to it and they were broken under zsh. The "problem" is that the documentation says things like %/ Present working directory ($PWD). If an integer follows the `%', it specifies a number of trailing components of $PWD to show; zero means the whole path. A negative integer specifies leading components, i.e. %-1d specifies the first component. However, after PWD has been assigned to, %/ still shows the actual current directory, not the value of $PWD. The same applies to ~+, ~- (and $OLDPWD), %~ and probably other things. The above section could be said to introduce $PWD as a local abbreviation of "Present working directory", but this section for example doesn't A `~' by itself is replaced by the value of $HOME. A `~' followed by a `+' or a `-' is replaced by the value of $PWD or $OLDPWD, respectively. Should I fix this, or does nobody care? And by fix, do I mean changing the appropriate occurrences of "$PWD" to "the current working directory" or something else? :) -- Mikael Magnusson