#!/usr/bin/perl # # pashn - simple perl shell with Readline support # $Id: pashn,v 1.1 2003/11/05 12:57:48 banjo Exp $ # # copyright 2003 Billy Naylor # banjo@actrix.co.nz # # This is GPL software... # See the GNU General Public Licence # http://www.fsf.org/licenses/gpl.txt # use Term::ReadLine; my $help = <new('PASH'); $terminal->ornaments(0); $terminal->MinLine(undef); $| = 1; my $prompt = "pashn; "; while () { my $editbuffer = $terminal->readline( $prompt ); while () { my $b = $terminal->readline(''); last unless $b; $editbuffer .= "$b\n"; } chomp $editbuffer; $terminal->addhistory($editbuffer); if ($editbuffer =~ s/^\s*\!//) { print qx|$editbuffer|; next; } eval ("$editbuffer"); print $@ if $@; print "\n"; next; } sub help { print $help } sub quit { exit 0 } # thankyuoverymuchGoodnight exit 0;