-
command line arguments and semi-colon
Hi all,
I've been playing around on a linux OS Ubuntu 9.04 and I wrote a small program that takes in a string as an argument.
The string is somewhat complicated so I terminate it with a ; (semi-colon) but for some reason (which I would like to know why) the ; doesn't appear part of the input string.
For example:
./tst <string>;
and my first line in the program is:
printf("My argument is: %s\n", argv[1]);
The semi-colon doesn't show in the string printed. However, if I use a comma , or some other character, it displays fine....
Any ideas of why this is happening?
thanks in advance
-
and the Hat of Guessing
Because ; means something to your shell, just like * means something to your shell and & means something to your shell....
-
Popular pages
Recent additions