#!/usr/local/bin/perl -w for(;;) #repeat forever { print "please enter a command\n"; $cmd = ; #get input from keyboard chomp ($cmd); #remove carriage return if ($cmd =~/^q$/i) #if cmd is quit { exit; #exit from program } else { if (fork== 0) #child process created { exec $cmd; #execute the command } wait; #wait for child process to terminate } }