#!/usr/bin/perl -w # bourne.pl "monkified" v1.0 # bart lines 5 & 29, and theorbtwo for ! delimiters line 36 use strict; ############ ## note: six assumptions are made here... ## 1) $USER legal characters are alphanumeric, "_", or "-" ## 2) $USER is between 3 and 16 characters in length ## 3) your default shell is a bourne-like shell (like bash) ## 4) you know enough bourne shell to not get in trouble ## 5) your $HOME directory is /home/$USER ## 6) you accept that you are using this at your own risk my @cmds = split /\n/, <<'--CMDs--'; ############ ## edit whoami pwd id echo \$PATH=$PATH echo \$PERL5LIB=$PERL5LIB perl -V ############ ## no edit --CMDs-- my $i=4; my $size=@cmds; my $me=`whoami`; my $dir=`pwd`; $me=~s/\n//; $dir=~s/\n//; $dir=~s!\/home\/[\w-]{3,16}\/!\/!; my $prompt="$me\@~$dir>"; print "Content-type: text/plain\n\n"; while ($i <= $size - 4) { my $cmd=$cmds[$i]; print $prompt,"$cmd\n",`$cmd`,"\n"; $i++; }