I am using C Shell.
My current working xmlstarlet command:
foreach xmlfile ( Test2/ResultReport1.xml Test3/ResultReport2.xml ) xmlstarlet sel -t -m '//RESULT_STEP' -v '@time_stamp' -o '|' -v '@step_name' --nl "$xmlfile" >> /scratch/rys/view_storage/outroo66.txt end
This reads 2 xml files in the above mentioned paths and writes the appended content to an output file. Works fine.
I have another text file (exp.txt) which has the above paths in 2 separate lines as shown below:
The below command works to echo the content of exp.txt line-by-line:
foreach line ( "`cat exp.txt`" ) echo $line end
Now, I want to use the second statement's output and pass it in the 1st statement for loop (like a sub-query) line-by-line.
I tried this:
foreach xmlfile ( foreach line ( "`cat exp.txt`" ) echo $line; end ) xmlstarlet sel -t -m '//RESULT_STEP' -v '@time_stamp' -o '|' -v '@step_name' --nl "$xmlfile" >> /scratch/ryerrams/view_storage/outroo66.txt end
But, this throws the below error:
Missing name for redirect
Is there any other way I can achieve the above? Please suggest. Thanks.