From owner-freebsd-hackers Mon Feb 3 15:17:41 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA27132 for hackers-outgoing; Mon, 3 Feb 1997 15:17:41 -0800 (PST) Received: from hydrogen.nike.efn.org (resnet.uoregon.edu [128.223.170.28]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA27105 for ; Mon, 3 Feb 1997 15:16:50 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by hydrogen.nike.efn.org (8.8.4/8.8.4) with SMTP id PAA19187; Mon, 3 Feb 1997 15:16:36 -0800 (PST) Date: Mon, 3 Feb 1997 15:16:33 -0800 (PST) From: John-Mark Gurney Reply-To: John-Mark Gurney To: Troy Curtiss cc: freebsd-hackers@freebsd.org Subject: Re: Two-way pipe possible without C/perl? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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)