Wildcard handling from Terminal

closed account (Lv0f92yv)
I am writing a small utility to resursively search all files in all subdirectories for a substring, and replace it with another.

I would like to handle wildcarding myself in my application, but when I run my program:

./a.out prefix* search replace

it seems that the terminal does the wildcarding for me, passing the args:

a.out prefix_01 search replace

where prefix_01 is one of the files I want to process.

Is there a way for the application to tell the terminal to not process wildcards? I suspect this might be something I specify when I run the command...?

Thanks
The shell is expanding the asterisk. Try escaping it with a backslash or put it in double-quotes.
closed account (Lv0f92yv)
That does seem to fix the immidiate problem.... (backslash escaping the asterix), but it looks like I'll have to come up with another convention for dealing with wildcards.... Thanks.
Well, dealing with wildcards can be a fun exercise. Try looking a regex.
Well, dealing with wildcards can be a fun exercise. Try looking a regex.


Totally agree. It is not as trivial as I thought, in fact that was what I experience a few years ago.
Topic archived. No new replies allowed.