in reply to Trying to pass variable output to subroutine

You might also want to add some quotes:
exec('sh -c "/export/home/weblogic/bai/bpps.sh stop";sh -c "/export/home/weblogic/bai/bpps.sh start" 2> /dev/null 2>&1');