Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this questionI have C binary program that receives one-word input. I have a file which contains a list of the words to be inputted to the program, one at a time.
so my script looks something like this"
while read line
do
./program ${line}
done < myfile"
If I replace ./program with echo, every argument is printed properly. However, when I input it into the program via alias ($line), program receives blank. Please explain how to fix it and why开发者_如何学Go this is happening.
make a debug program to see what is going on...
int main (int argc, const char * argv[])
{
printf("\n");
// insert code here...
for(int i = 0; i< argc ; i++)
{
printf("argc == %i, argv[%i]==%s\n",argc,i,argv[i]);
}
return 0;
}
精彩评论