* Re
[not found] <9412081718.AA119815@rexsrvr2.summitis.com>
@ 1994-12-08 18:12 ` hc05
0 siblings, 0 replies; only message in thread
From: hc05 @ 1994-12-08 18:12 UTC (permalink / raw)
To: sam-fans-owner
>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
-------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1994-12-08 21:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <9412081718.AA119815@rexsrvr2.summitis.com>
1994-12-08 18:12 ` Re hc05
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).