zsh-users
 help / color / mirror / code / Atom feed
From: Grant Taylor <gtaylor@tnetconsulting.net>
To: Roman Neuhauser <neuhauser@sigpipe.cz>
Cc: zsh-users@zsh.org
Subject: Re: cd x x.something
Date: Tue, 26 Sep 2017 19:23:04 -0600	[thread overview]
Message-ID: <1ed5e1c7-a0c7-0c65-c158-645954355702@tnetconsulting.net> (raw)
In-Reply-To: <20170926235627.GA274726@isis.sigpipe.cz>

On 09/26/2017 05:56 PM, Roman Neuhauser wrote:
> can you elaborate how?  it surely should:

I'll have to look at my command history at work where I tried this.

> $ mkdir omg omg.wtf
> $ cd omg
> $ pwd
> /home/roman/omg
> $ cd $PWD.wtf
> $ pwd
> /home/roman/omg.wtf

That works for me at home.

I'm guessing that I used "omg.wtf" instead of "$PWD.wtf".  Which leads 
me to think that this is something special that acts on the PWD 
environment variable.

Or there's some sort of environment variable permutation that I'm not 
aware of.  Which is completely possible.

> `cd foo bar` does not "move laterally", it's like `cd ${PWD:s#foo#bar}`,
> except `foo` is not treated as a glob.  this doesn't look lateral to me:
> 
> $ mkdir x
> $ cd x
> $ pwd
> /home/roman/x
> $ mkdir -p .$PWD
> $ cd / ./
> $ pwd
> /home/roman/x/home/roman/x

Okay, I see what you're saying.

% cd /dev/shm
% mkdir omg omg.wtf
% cd omg
% pwd
/dev/shm/omg
% cd omg omg.wtf
% pwd
/dev/shm/omg.wtf

That's why I was saying laterally.

> no, i meant what i wrote: since the second directory differs from $PWD
> only in the ".bak" suffix, `cd $PWD.bak` will have the desired effect.

Fair.

Thank you for the explanation Roman.



-- 
Grant. . . .
unix || die


  reply	other threads:[~2017-09-27  1:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25  2:19 tuxic
2017-09-25  3:55 ` Amir Ish-Hurwitz
2017-09-25  7:25 ` Dominik Vogt
2017-09-26 18:50 ` Roman Neuhauser
2017-09-26 19:47   ` Grant Taylor
2017-09-26 23:56     ` Roman Neuhauser
2017-09-27  1:23       ` Grant Taylor [this message]
2017-09-27  3:47         ` Bart Schaefer
2017-09-27  4:05           ` Grant Taylor

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=1ed5e1c7-a0c7-0c65-c158-645954355702@tnetconsulting.net \
    --to=gtaylor@tnetconsulting.net \
    --cc=neuhauser@sigpipe.cz \
    --cc=zsh-users@zsh.org \
    /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).