if($input eq "-c"){ print "Enter Command: "; my $cmd = ; chomp($cmd); print $fh $cmd; print $fh "\n\t#### START COMMAND OUTPUT ####\n"; print `$cmd`; foreach(`$cmd`){ print $fh "#".$_; } print $fh "\t#### END COMMAND OUTPUT ####\n"; next; } #### #!/bin/bash perl /path/to/script/script.pl $1 $2 $3 $4