bug-bash
[Top][All Lists]
Advanced

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

Re: bash completion of an option with a space in it, isn't double quoted


From: Chet Ramey
Subject: Re: bash completion of an option with a space in it, isn't double quoted
Date: Tue, 26 Mar 2019 10:31:21 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.0

On 3/26/19 3:43 AM, d3fault wrote:

> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
> 
> Description:
>       In the following example it auto-completes without putting double
> quotes around "hi mom", which means a process would see it as 2
> separate args instead of 1.

If you want the words to be quoted, you have to say they should be quoted.
If you want them quoted like filenames, tell complete they should be
treated as filenames.

>         $ complete -W "hi\ mom foo bar" ls

complete -o filenames -W "hi\ mom foo bar" ls

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



reply via email to

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