1

How to keep unix from evaluating a file pattern

view story
linux-howto

http://www.unix.com – How do I keep a file pattern from evaluating? I want to pass in a file pattern to a script as a parameter, and then use that pattern in subsequent statements, but I can't get the pattern to not evaluate before I use it. For example, if I have 3 files called file1.txt, file2.txt and file3.txt and in my script I have something like this: num=`ll $1 | wc -l` and I pass file*.txt in as my parameter, num always = 1. Because $1 evaluates to "file1.dat file2.dat file3.dat", all one line. So essentially my statement says num=`ll file1.dat file2.dat file3.dat | wc -l` How do I g (HowTos)