[Bash-completion-devel] [SCM] bash-completion branch, master, updated. 1.90-50-g834379e

Ville Skyttä ville.skytta at iki.fi
Sun Nov 20 10:18:12 UTC 2011


On 11/20/2011 12:05 PM, Ville Skyttä wrote:
> On 11/20/2011 02:45 AM, Igor Murzov wrote:
>> What about something like this?:
>> ------------------------------------------
>> $ for f in /usr{,/local}/lib{,64}/valgrind/*; do
>>     [[ -x "$f" && "$f" != *.so ]] && echo "$f" | sed -ne 's/^.*\/\(.*\)-\([^-]*\)-\([^-]*\)/\1/p'
>> done
> 
> Seems to work for me.  But it could be improved at least to test the !=
> *.so case before the -x to save some stat calls, use printf instead of
> echo, and drop the unnecessary quoting inside [[ ]].

Actually, even better is to pass sed's stdin with <<<$f instead of
printf or echo and a pipe.



More information about the Bash-completion-devel mailing list