bug-bash
[Top][All Lists]
Advanced

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

Re: Strange compgen behaviour


From: Mathias Dahl
Subject: Re: Strange compgen behaviour
Date: Fri, 25 Sep 2009 05:25:28 -0700 (PDT)
User-agent: G2/1.0

> Interesting! Can I make it part of my pipe (in place of `sed') or need
> I change it to a for or while loop? This is what I have now:
>
> files=$(find /home/mathias/Videos/movies/ -iname "*.avi" -type f -
> printf "%P\n" | grep "${cur}" | sed "s/\\([][\\(\\) ,\']\\)/\\\\\\1/
> g")

Got this to work:

 files=$(find /home/mathias/Videos/movies/ -iname "*.avi" -type f -
printf "%P\n" | grep "${cur}" | while read file; do
            printf %q "$file"
            echo
    done)

With the %q option to printf it no longer accepts a \n so I needed the
extra echo.

/Mathias


reply via email to

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