Re: compgen -W doesn't split wordlist containing single quotes
From:
Chet Ramey
Subject:
Re: compgen -W doesn't split wordlist containing single quotes
Date:
Sat, 17 Mar 2018 13:06:47 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
On 3/16/18 1:00 PM, marcelpaulo@gmail.com wrote:
> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
>
> Description:
> compgen -W "wordlist" doesn't split wordlist on $IFS if wordlist contains
> unquoted single quotes. For instance, this wordlist, "foo'bar aaa bbb", won't
> be split using the default value of IFS: it will be treated as a single word.
Processing the word argument to -W honors shell quoting, in order to
provide a simple way to return words containing shell metacharacters and
characters in $IFS. There is a sentence to this effect in the texinfo
documentation, but that sentence is missing from the manual page. I will
add some clarifying text and make sure it appears in the man page.
Chet
--
``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/