[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "$PWD"/m.ter<tab> removes the quotes on expand
From: |
Greg Wooledge |
Subject: |
Re: "$PWD"/m.ter<tab> removes the quotes on expand |
Date: |
Sun, 10 Nov 2024 15:07:07 -0500 |
On Sun, Nov 10, 2024 at 20:52:44 +0100, Andreas Kähäri wrote:
> On Sun, Nov 10, 2024 at 07:58:28PM +0100, #!microsuxx wrote:
> > i try on fresh new termux
> > to expand
> >
> > "$PWD"/smth<tab>
> >
> > it makes when completed the quotes away
> >
> > as a side note , there are no spaces in $PWD
> >
> > greets
>
> Can you say what the issue with this is? As far as I can see, the quotes
> are not needed in the case you are describing, and if there were spaces
> or globbing characters in the value of $PWD, these would be individually
> quoted by the shell (using \) when the variable is expanded as part of
> the completion.
hobbit:~$ mkdir /tmp/'with spaces'
hobbit:~$ cd "$_"
hobbit:/tmp/with spaces$ touch x1 x2
hobbit:/tmp/with spaces$ ls $PWD/x2
ls: cannot access '/tmp/with': No such file or directory
ls: cannot access 'spaces/x2': No such file or directory
In the last command, I typed ls "$PWD"/x and then used tab. The quotes
were removed, as the OP reported, and in this case it's not harmless.
Backslashes were not added, nor would I expect them to be, as the spaces
are in the content of the variable, not in the input line.