Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: cannot `cd $_` to $_ containing spaces
- X-seq: zsh-workers 47454
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Soren Roth <sorenoid@xxxxxxxxx>
- Subject: Re: cannot `cd $_` to $_ containing spaces
- Date: Wed, 14 Oct 2020 09:25:31 +0200
- Archived-at: <https://zsh.org/workers/47454>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-10/CAN%3D4vMrws-m2pFP4Dg7BpfQ3vYrGnJNa12T4SvffbF4rgxhfyQ%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-il1-f177.google.com) smtp.remote-ip=209.85.166.177; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xj4XrgZwVGlrdbH2H2q05HTpISsXlRx0dy92Ve/idTw=; b=GF25gKjxtz4UBh86xbPoV+96pCzgZBWPP9MdOiuIq6+uAGisYbycaxTSciqXofsMBH +7FhxhL8lAEsmcf0+2NQFSp+r3NeGwBs3KdnvYujh1qAhjHmNzh1zyVYq/jiqEEUJ7Me Y8akgv2HZa0bZ62m2WxKkguv/6Z79MTMK7PeYtZU3N+lT2aijSC5bs0WZm1hPoHzhfc6 sWAxsJsdKkPSN7TBiSJSGTBovTq4SjwPgzquuz9ydwxTDHVs0NIciJUa9DOTPDSydDde Dl1Y4Y9WT0fnxI4Gy4ExXOChC1xe5VIpEelqVrkHK6umtqGxnxEDT9fN0dwWzBUXxhPN lGXA==
- In-reply-to: <CAA0W15K=fUvCSabfCADVnp7Gr9P4awsC2KdhjV67K1viDE_nmQ@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>
- Sender: zsh-workers-request@xxxxxxx
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 "$_"
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author