Simple scripting: Prevent an "*" in a variable from resolving during runtime
Posted on 2005-04-25
Hopefully this is a simple question. It was triggered while I was trying to help someone ELSE in EE with scripting.
Is there a way to stop a variable with an “*” in it from resolving the “*” at runtime?
In the script called test2...
for var in $*
...I get the following results if I run ...
ksh # ./test2 a b "test" d
...which is what I want. HOWEVER, if I run the script with the following parameters ...
ksh # ./test2 a b "*test*" d
...I get a listing of all the “test” files in the dir...instead of it listing “*test*” WITH the asterisks, like follows ...
How do I get it to echo (or grep or whatever) the “*test*” WITH the asterisks, instead of functionally resolving them?