[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
- Re: Strange compgen behaviour, (continued)
- Re: Strange compgen behaviour, Chet Ramey, 2009/09/24
- Re: Strange compgen behaviour, Bernd Eggink, 2009/09/24
- Re: Strange compgen behaviour, Chet Ramey, 2009/09/24
- Re: Strange compgen behaviour, Chris F.A. Johnson, 2009/09/24
- Re: Strange compgen behaviour, Chet Ramey, 2009/09/25
- Re: Strange compgen behaviour, Bernd.Eggink, 2009/09/25
- Message not available
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/24
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/24
- Re: Strange compgen behaviour, Greg Wooledge, 2009/09/25
- Message not available
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/25
- Re: Strange compgen behaviour,
Mathias Dahl <=
- Re: Strange compgen behaviour, Andreas Schwab, 2009/09/25
- Message not available
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/25
- Re: Strange compgen behaviour, Bernd Eggink, 2009/09/25
- Message not available
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/25
- Re: Strange compgen behaviour, Mathias Dahl, 2009/09/25