I have a program that takes in a string as parameter and the searches the string in a text file.
Everything works perfectly except when I enter * as the parameter. It prints out all the file name in my directory. Seems it doesn’t go through the code when I enter * as the parameter.
Anyone know whats going on?
Your shell is expanding the
*before it gets to your program. Try escaping it like so