php script problem

 $result = shell_exec("/sbin/checkscript.sh jdoe");
 echo "$result" ;

i am running a script through php. the script is /sbin/checkscript jdoe.

this script is supposed to output something similar to this:

################################
####  Welcome John Doe
################################

The problem is, in the webpage, php doesn't show the output of the script as cleanly as this.

it meshes them all together in one line like this:

####################################  Welcome John Doe ################################

how can i modify my php code so that whatever the script returns shows up in the webpage just as it would have from the commandline?

i have tried removing the quotes on the "results". same problem. any ideas?