How do I pass in the asterisk character ‘*’ in bash as arguments to my C program?

The shell is replacing the asterisk with the name of each file in the directory.

To pass a literal asterisk, you should be able to escape it:

$ ./a.out 123 \*

Leave a Comment