I have an input file of this form:
Some text here
Another text here
Something else here
Now I want to write a linux script picks one line at a time from input file and creates a separate file which stores just the line received. After this I want to pass this file to a program (for which I have just binary file). Is it possible to write such a linux script. I am used to programming in C++ I know it is possible there. But I want to know if something like this is possible using linux script. Basically I intend to do the following:
read inputfile.txt line by line
store line read in inputFileInside.txt
./myprogram paramater1 inputFileInside.txt //run my C++ binary file which I usually run as (root$./myprogram parameter1 inputFileInside.txt)
sudo sh -c \"sync; echo 3 > /proc/sys/vm/drop_caches\"
exit when the input file has been read