#!/usr/bin/perl
# Name:		pmsh: Perl Mini-Shell
# Author:	David Ljung Madison <DaveSource.com>
# See License:	http://MarginalHacks.com/License
# Description:	Just a perl-writing test  - see also mish.c

sub do {
  chop;
  s/^\s+//;
  ($_ eq "exit") && exit;
  @a=split(/\s+/,$_);
  if ($a[0] eq "cd") {
    chdir($a[1]);
  } else {
    exec @a unless fork;
    wait;
  }
  print "pmsh> ";
}

print "pmsh> ";
&do while <>;
