#!/bin/bash #bash -i &> file.log #exit #myoutput=$(echo "echo hello ; exit" | bash -i) #echo "follow\n" #echo $myoutput #echo "echo hello" | (bash -i &>file.log) #echo hello #exit #echo "echo hello" | bash -i 2>&1 | \ #( # read myoutput; # echo "myoutput :\n"; # echo $myoutput; #) #myoutput=$(echo "echo hello" | bash -i 2>&1 | (read foo; echo $foo)) myoutput=$( (echo "echo hello" ; echo "echo hugo") | bash -i 2>&1) echo "myoutput :" echo "$myoutput"