Call read twice:
echo -e "AAA\nBBB" | { read line1 ; read line2 ; echo "$line2" ; }
Note that you need {} , so make sure that both commands receive the same input stream. In addition, variables are not available outside of {} , so this does not work:
echo -e "AAA\nBBB" | { read line1 ; read line2 ; } ; echo "$line2"
Aaron digulla
source share