I have a C program "main" which gets the following parameters:
"a b c d ..." e f g
That's a total of 4 parameters, because of the quotation. I have a text file which each line has these 4 parameters. I made a shell script to run the C program for each of the parameters:
#!/bin/bash
while read line
do
./main "$line"
done < $1
The problem is that the C program is recognizing the first parameter, which is quoted, as several separated parameters, as if the quote was being ignored. Among the many things I've tried, it's worth mentioning that I tried changing each quotation in the file to \" and even remove the quotation from the call (./main $line).