----------C program-----------------------------
include <stdio.h>
int main( int argc, char *argv[] )
{
int i;
for( i=0; i<argc; i++ )
printf("%\n", argv[i]);
return 0;
}
I wrote the C program above 'print.c'.
Then, I compiled. (gcc -o print.o print.c)
Don't call the output print.o. print.o would be the default name for an object module. You would probably call the linked executable "print". At least that's a better choice than print.o. But "print" is also the name of a ksh built-in...
Anyway to run it with args just do...
./print arg1 arg2 arg3
And finally your format string in the printf call needs a little work. It's %s to print a string.