I am having trouble understanding how my code is working. I am new to this project and never learned unix before. My coworker quickly showed me how to run the program but didn't explain how it worked
After making sure all the C++ files compiled properly by running make, he went to the command prompt and typed
I took a look at the "run.sh" file. It is below:
Code:
DIR=/directory/scripts/binaries/what
LIST=$1
while read PDF
do
echo "HOLD ON ${PDF}..."
./makeInputAX.sh ${PDF} ${PDF} >INPUT/${PDF}.something
${DIR} -AX INPUT/${PDF}.something # I don't want to reveal the actual types of files I'm dealing with, so I called them 'something'
done < ${LIST}
the "makeInputAX.sh" file is:
Code:
$PDF=1
echo "THEFILE ABC/{PDF}.something"
and "list.txt" simply contains:
So I already know that run.sh reads whats inside "list.txt", and assigns "12345" to be the "LIST" variable. I do see "HOLD ON 12345" in the command prompt. What confuses me is that I thought "run.sh" runs first, then calls "makeInputAX.sh", so how can "PDF" be assigned to "list.txt", when that assignment was in "makeInputAX.sh" not "run.sh"?
What also confuses me is that in the command prompt, I then see the outputs from the program, as they were written in the cpp files that are part of the project. However, those files are in a seperate directory, not in "/directory/scripts/binaries/what". I made changes to those cpp files and want to see the new outputs I should get, but I am getting an error:
Code:
could not open the somethingelse file for read
However,
Code:
could not open the ..
is not written anywhere in my C++ code. To fix that, do I need to look in my cpp files or is there something to these sh files that can help?