> 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