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

Avoiding pattern expansion in bash?



This might be a little off topic but here it goes anyway.

I am writing a bash script that takes as input a file expression such as 
"/etc/lilo.conf" or "/boot/config*" etc. I want to keep those strings as 
they are (including the *) and echo them to a file. How do I prevent bash 
from doing its pattern expansion where it turns /boot/config* into a list 
of files that match the expression. 

If I use echo "$1" it becomes the first file that matches the 
expression /boot/config*. If I use echo "$*" it becomes a space separated 
list of all the files that match the expression. I want none of this.

Any ideas?

Regards
Olle Eriksson



Reply to: