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

bash variables



I occasionally have problems with bash variables, for instance
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.

In the same vein this command lists nothing:
root@/deb40a:~> FIND="-name '*'"; find /root/bin $FIND
while
root@/deb40a:~> find /root/bin -name '*'
lists 25 files.

This only bites me once in a while but when it does it can be very
frustrating so any hints / tips are welcome.
Thanks,
Mike McClain
-- 
Satisfied user of Linux since 1997.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org


Reply to: