help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "$PWD"/m.ter<tab> removes the quotes on expand


From: Chet Ramey
Subject: Re: "$PWD"/m.ter<tab> removes the quotes on expand
Date: Mon, 11 Nov 2024 09:26:15 -0500
User-agent: Mozilla Thunderbird

On 11/10/24 1:58 PM, #!microsuxx wrote:
i try on fresh new termux
to expand

"$PWD"/smth<tab>

it makes when completed the quotes away

It's a bit more subtle than that. When bash detects that there are
characters in the directory name that require quoting -- since it has
to expand the variable to find the directory to open for possible
completions -- it quotes the completed word.

$ mkdir dir\ with\ spaces
$ cp bash dir\ with\ spaces/
$ cd dir\ with\ spaces/

Here I typed "$PWD"/ba[TAB]

$ "$PWD/bash"


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]