From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <24140>; Thu, 8 Dec 1994 16:17:59 -0500 Return-Path: uunet.uu.net!rexago8!rserv1!rexago8!hc05 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24138>; Thu, 8 Dec 1994 13:12:24 -0500 Received: from uucp2.UU.NET by relay3.UU.NET with SMTP id QQxtkq24553; Thu, 8 Dec 1994 13:12:06 -0500 Received: from rexago8.UUCP by uucp2.UU.NET with UUCP/RMAIL ; Thu, 8 Dec 1994 13:12:07 -0500 Received: by summitis.com (smail2.5) id AA00772; 8 Dec 94 12:54:53 EST (Thu) Received: from summitis.com by rserv1.summitis.com; Thu, 8 Dec 1994 12:53 EST Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA148734; Thu, 8 Dec 1994 12:53:51 -0500 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA17166; Thu, 8 Dec 1994 12:53:48 -0500 From: hc05@summitis.com Message-Id: <9412081753.AA17166@cheetah> Subject: Re To: sam-fans-owner In-Reply-To: <9412081718.AA119815@rexsrvr2.summitis.com> from "sam-fans-owner@hawkwind.utcs.toronto.edu" at Dec 8, 94 12:17:00 pm X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Date: Thu, 8 Dec 1994 13:12:18 -0500 Resent-To: sam-fans Resent-Date: Thu, 8 Dec 1994 16:17:54 -0500 Resent-From: Chris Siebenmann Resent-Message-Id: <94Dec8.161759est.24140@hawkwind.utcs.utoronto.ca> >Greetings. I use 'mush' as my mail program, and I have my EDITOR environment >variable set to use sam. The problem comes when I have a sam running, and >then I go to read mail. When I edit my file, it cranks up another sam. But >when that sam quits, it removes the fifo in /tmp that the `B' command uses. >At that point, I can no longer use `B' to communicate with my orignal sam. > >My question is, how do *you* handle this? Does anyone have a shell script >that runs B on their temporary mail file such that things stay in sync >after the file is written back out with sam? I rewrote B to handle this and it works fairly well. Its written in perl, but you are welcome to rewrite it in other shell languages if you like. Beirne #!/usr/local/perl @files = (); if (@ARGV == 0) { print STDERR "usage: B [-nnnn] files...\n"; exit 1; } $dir = `/bin/pwd`; chop $dir; ($name) = getpwuid($>); $pipe = '/tmp/.sam.'.$name.'.'.$ENV{'DISPLAY'}; foreach (@ARGV) { if (m#^/#o) { push(@files, $_); } elsif (m#^-#o) { $line = substr($_, 1); } else { push(@files, $dir.'/'.$_); } } if (defined($ENV{'DISPLAY'}) && -w $pipe) { open(PIPE, '>'.$pipe) || die "Can't open $pipe: $!"; print PIPE "B ", join(' ', @files), "\n"; print PIPE $line, "\n" if (defined($line)); close(PIPE); } elsif (defined($ENV{'DISPLAY'})) { exec 'sam', @files; } else { $editor = 'vi'; exec $editor, "+$line", @files; } -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon -------------------------------------------------------------------------------