help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Performing quote removal on data


From: Greg Wooledge
Subject: Re: [Help-bash] Performing quote removal on data
Date: Wed, 28 May 2014 16:44:31 -0400
User-agent: Mutt/1.4.2.3i

On Wed, May 28, 2014 at 04:05:47PM -0400, Maarten Billemont wrote:
> 2a. One such case is doing pathname completion, but here we can fall back to 
> compgen -o bashdefault:
> 
> IFS=$'\n' read -r -d '' COMPREPLY < <(compgen -o bashdefault "$partial*") # 
> notice the trailing *

I think you've taught me that I don't know a damned thing about bash
programmable completion.

imadev:~/tmp$ mkdir -p "dir "{1,2}
imadev:~/tmp$ echo dir*
dir 1 dir 2
imadev:~/tmp$ compgen -o bashdefault "di"
imadev:~/tmp$ compgen -o bashdefault "di*"
imadev:~/tmp$ compgen -o default "di"
dir 1
dir 2
imadev:~/tmp$ compgen -o default "di*"
imadev:~/tmp$ rmdir dir\ [12]

Sorry if I misunderstood the goal.  Apparently, I don't understand the
compgen command either.

Good luck.



reply via email to

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