If the first script is going to send data to stdout, and the next script is going to take it as stdin (in other words, there's going to be a pipe in here somewhere), why not just you temporary environment variables?
At the end of the first script:
Code:
temp_transfer_var1=value of output line 1
temp_transfer_var2=value of output line 2
export temp_transfer_var1 temp_transfer_var2
Near the beginning of the second script:
Code:
internal_var1=${temp_transfer_var1}
internal_var2=${temp_transfer_var2}
unset temp_transfer_var1 temp_transfer_var2
==============
Another way is to do a classic "while read" (again, assuming the command structure is: script1 | script2)
Code:
internal_var1=""
internal_var2=""
while read output_line ;
do
if [ "${internal_var1}x" = "x" ] ; then
internal_var1=${output_line}
else
internal_var2=${output_line}
fi
done