hope someone can help.
I’m working on a problem set passing arguments in C99 on Ubuntu, part of the problem set specifies that non-integer characters should lead to an early return from the main function and program termination.
For example:
#include <stdio.h>
int main(int argc, string argv[])
{
// code
}
I’ve discovered that if I pass the program a '
character at the end of a series of digits e.g. ./runme 12345'
it seems to open some kind of shell/prompt.
Can anyone help with what this is?
2
Answers
As John3136 wrote in a comment:
This is not related to C, but to your shell. In bash, a single quote has special meaning to the shell, and if you want to pass it to some other program, you have to quote it, for instance
or
This applies of course to all shell meta-characters.