In the bash script all the echo commands are stored into a file let's say its name is "aaa".Then for every line I read from that file in the script I have to pass it into the pipe in order my .cpp reads what the script sends.So in the script I have:
where line is every line of the file aaa and $2 is the name of the pipe the line has to be written to.Code:while read line; do echo $line >> $2 done < 'aaa'
Then in my .cpp program I do:
where child is the ifstream the .cpp reads the pipeCode:while(child.getline(line,LINESIZE)){ cout<<line<<endl; sleep(1); }
Is there another way to write my data from the script to the pipe?
It's the most simple I can think of..



1Likes
LinkBack URL
About LinkBacks



