Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: cannot `cd $_` to $_ containing spaces
- X-seq: zsh-workers 47457
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: cannot `cd $_` to $_ containing spaces
- Date: Wed, 14 Oct 2020 20:49:21 +0000
- Archived-at: <https://zsh.org/workers/47457>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-10/20201014204921.22cd9cc3%40tarpaulin.shahaf.local2>
- Authentication-results: zsh.org; iprev=pass (out4-smtp.messagingengine.com) smtp.remote-ip=66.111.4.28; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none
- Cc: Soren Roth <sorenoid@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=fm1; bh=0s2ezbpwakUeCrew3ijem3aR3I 6YPQJeYa6W9QhENrw=; b=hAGhmtFGHvepDdUrZfyhAQetHx3lewo2q3+LEYf4MZ rOswLAIbNHRbQQCJe1jeoSm9vz2/u+pBa4a0K+gKG7y11IEmfdYTWq+gNkmrAogd 3tksYSHdoZ8NN14WpMce7LjhiKc0Pq/pXGvrpmd+5iOzLJ67IbYCYwr+Cj4zRKLu CD3q3ydJCuciYLlojf3JwnuWswdjUyTn/xCxZ8ohEUVZwHSaoDC6jyZzQccV8iyC ybRgE5Ip9ocmFOTMflN5bian080Pzmp0rtnKaEyPYZL+Ug2JzvSCu9xy0h/11cLM sOuW+/8WHiuHpefqjQX/e2dOe+WT4FqxFyovCeYHb/Xg==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=0s2ezbpwakUeCrew3ijem3aR3I6YPQJeYa6W9QhEN rw=; b=PcE2DW/9Xf9QCUiWGdLBBj+3OfAnGFkELY8qfVm3Qr33HreMy/hwm6ZY0 Q3gQF+iRcQQocuZsRKw/iEQgPKX8c/4zWEpRybvO/EknuJ0R3J6UegHjJ2TLqrgF S+7ch2FR55hXEbTCduVQOkR8tNH7AOjFgpBdwbSNswqaIvG3UtUQ7YCxvIY1Jl1k vFKgaVPkhTe79D8jFPHFd9uBDEbU/1e7+wNPmcNpsP+fqFyX9b8HTksGyGaLCWWo 0lJ636uVHywlwY/p9NycAv+Iuw7Ixj8DzlKcVLRcLJ0nH80mvvmPRl7KGhXG2oz1 8Nrtm4pipmTXcZQbRb/JMeRuBMO2Q==
- In-reply-to: <CAN=4vMrws-m2pFP4Dg7BpfQ3vYrGnJNa12T4SvffbF4rgxhfyQ@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <CAA0W15K=fUvCSabfCADVnp7Gr9P4awsC2KdhjV67K1viDE_nmQ@mail.gmail.com> <CAN=4vMrws-m2pFP4Dg7BpfQ3vYrGnJNa12T4SvffbF4rgxhfyQ@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
Roman Perepelitsa wrote on Wed, 14 Oct 2020 09:25 +0200:
> On Tue, Oct 13, 2020 at 9:31 PM Soren Roth <sorenoid@xxxxxxxxx> wrote:
> > I made a directory with a space in the name, and tried to cd into it using $_, and failed.
>
> You probably have the SH_WORD_SPLIT option enabled. This option causes
> field splitting to be performed on unquoted parameter expansions, like
> in POSIX sh. You can turn it off by adding `unsetopt SH_WORD_SPLIT` to
> ~/.zshrc. Otherwise you need to quote parameter expansions to prevent
> field splitting (again, like in POSIX sh).
>
> cd "$_"
The SH_WORD_SPLIT option defaults to being disabled, so if you have it
enabled, you might wish to check why that's the case in the first
place, rather than simply to append an «unsetopt» to your configuration.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author