#!/usr/bin/perl -w use strict; $_ = select(STDOUT); $| = 1; select($_); while (<>) { chomp; last if $_ eq 'exit'; @_ = `sh -c "$_"`; $_[0] = "\n" unless @_; print @_; }