Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Feb 1997 15:16:33 -0800 (PST)
From:      John-Mark Gurney <jmg@nike.efn.org>
To:        Troy Curtiss <troyc@sandy.merix.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Two-way pipe possible without C/perl?
Message-ID:  <Pine.NEB.3.95.970203151149.27974E-100000@hydrogen.nike.efn.org>
In-Reply-To: <troyc-9701032246.AA0002700@sandy>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 3 Feb 1997, Troy Curtiss wrote:

> Hi,
>   I am looking for a very quick and dirty way to have my FreeBSD
> box page me when certain systems go down at work.  The easiest way
> I can think of is to create a 2-way pipe between a chat command and
> the cu command.  Something like:
> 
> chat " '' ATZ OK ATDT1800PAGER# CONNECT 'PIN12345' Sent ATH" <->
>   cu -l /dev/cuaa0 -s 300
> 
> in a shell script or etc...  Is there a shell (sh, csh, tcsh, bash)
> mechanism to wire process A's stdin to process B's stdout, and vice-
> versa, or am I going to have to use perl/expect/C (more time-consuming)?
> No big deal, but if anybody has a good idea, I'd appreciate it.

why not just do something like this:
chat -f file < /dev/cuaa0 > /dev/cuaa0

and if you need uucp locking do something like this:
if shlock -p $$ -f /var/log/LCK.ttyd0; then
	chat -f file < /dev/cuaa0 > /dev/cuaa0
else
	echo someone else has the modem
fi

hope this helps...

John-Mark

gurney_j@efn.org
http://resnet.uoregon.edu/~gurney_j/
Modem/FAX: (541) 683-6954   (FreeBSD Box)

Live in Peace, destroy Micro$oft, support free software, run FreeBSD (unix)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.95.970203151149.27974E-100000>