Here I want to know that what is system()?
When you said system()
and hit Enter, the shell thought that you were about to define a shell function named system
.
Anything starting with #
is interpreted as a comment by the shell.
You got an error in the int main()
line because your function body had not started.
The syntax for a shell function is:
function: function name { COMMANDS ; } or name () { COMMANDS ; }
Define shell function.
An example of how you might define a function and use it:
$ system()
> { echo $SHELL; }
$ system
/bin/bash