From owner-freebsd-questions Thu Jun 14 5: 9:16 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail2.mediadesign.nl (md2.mediadesign.nl [212.19.205.67]) by hub.freebsd.org (Postfix) with SMTP id AE2C237B403 for ; Thu, 14 Jun 2001 05:09:01 -0700 (PDT) (envelope-from alson@mediadesign.nl) Received: (qmail 2517 invoked by uid 1002); 14 Jun 2001 12:09:00 -0000 Date: Thu, 14 Jun 2001 14:09:00 +0200 From: Alson van der Meulen To: FreeBSD-questions@FreeBSD.ORG Subject: Re: Keyboard Keystroke in a Shell Script Message-ID: <20010614140900.J27948@md2.mediadesign.nl> Mail-Followup-To: FreeBSD-questions@FreeBSD.ORG References: <5.1.0.14.2.20010614152911.0298c728@mail.ideal.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20010614152911.0298c728@mail.ideal.net.au> User-Agent: Mutt/1.3.18i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jun 14, 2001 at 03:38:25PM +1000, Chris Aitken wrote: > Hi all, > > I got a bit of a curley one that I cant seem to find any answers..... > > Im writing a shell script (or possibly a perl script... depending on how it > needed to be implimented) and im very much a novice at this stuff. What > this script is doing, is accessing a device hanging off the serial port of > a FreeBSD 3.4 box. > > Im using cu to access the port, and I can issue the required commands on > the command line no dramas. What I want to do is write a script which will > excecute cu in the command line, issuing the needed lines of data and get > out. Here is an example of how I would be accessing the device..... > > ----------- > % cu -l /dev/cuaa1 -s 38400 > > ABCD1234 > Hello, this is a sentence > > ----------- > > How do I issue the and the keyboard strokes to cu in a > script? Im pretty sure I can work out how to send the required commands and > text, but the keyboard strokes are bugging me. echo 'ABCD1234 Hello, this is a sentence'|cu -l /dev/cuaa1 -s 38400 should do the trick, or try using cat < Name: Alson van der Meulen < > Personal: alson@linuxfreak.nl < > School: alson@gymnasiumleiden.nl < `-------------------------------------------' Well, my files were backed up. --------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message