From owner-freebsd-questions Thu Jun 14 12:42:23 2001 Delivered-To: freebsd-questions@freebsd.org Received: from shumai.marcuscom.com (rdu26-228-058.nc.rr.com [66.26.228.58]) by hub.freebsd.org (Postfix) with ESMTP id DF90137B405 for ; Thu, 14 Jun 2001 12:42:16 -0700 (PDT) (envelope-from marcus@marcuscom.com) Received: from localhost (marcus@localhost) by shumai.marcuscom.com (8.11.3/8.11.3) with ESMTP id f5EJgJI05161; Thu, 14 Jun 2001 15:42:20 -0400 (EDT) (envelope-from marcus@marcuscom.com) X-Authentication-Warning: shumai.marcuscom.com: marcus owned process doing -bs Date: Thu, 14 Jun 2001 15:42:19 -0400 (EDT) From: Joe Clarke To: Chris Aitken Cc: Subject: Re: Keyboard Keystroke in a Shell Script In-Reply-To: <5.1.0.14.2.20010614152911.0298c728@mail.ideal.net.au> Message-ID: <20010614154002.D5149-100000@shumai.marcuscom.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Chris, what exactly are you trying to control? You may want to use something like expect, or the p5-Expect Perl module (/usr/ports/lang/p5-Expect) to control the spawned cu command. Joe Clarke On Thu, 14 Jun 2001, 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. > > > Any help would be great.... Thanks > > > Chris > > > -- > Chris Aitken - Webmaster/Database Designer - IDEAL Internet > email: chris@ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890 > -------------------------------------------- > > If the foo shits, call your sysadmin > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message