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

Re: bash variables



On Sat, Feb 26, 2011 at 03:18:43PM +0000, T o n g wrote:
> On Fri, 25 Feb 2011 14:21:27 -0800, Mike McClain wrote:
> 
> > the following command lists (along with everything else)
> >  2 *.deb files in /home/mike/
> > 
> > root@/deb40a:~> FIND1="-maxdepth 1 -type f -print -name '*'"; \
> >     GREP="-v '\.\(deb\|gz\|tgz\|bz2\|tbz\|zip\)$'"; \ find /home/mike/
> >     $FIND1 | grep $GREP ;
> > 
> > while without variables;
> > root@/deb40a:~> find /home/mike/ -maxdepth 1 -type f -print -name '*' |
> >     grep -v '\.\(deb\|gz\|tgz\|bz2\|tbz\|zip\)$'
> > does not list the 2 *.deb files.
> 
> Shouldn't be. Are you sure you are posting exactly as what you are doing 
> without omitting anything else?

Absolutely sure.
There is something about the way that bash expands variables that's
caused me headaches for years. Try it yourself.
Mike

-- 
Satisfied user of Linux since 1997.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org


Reply to: