FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Linux

 
 
LinkBack Thread Tools
 
Old 12-15-2010, 11:35 AM
Romeo Theriault
 
Default Using enter key in bash script

On Wed, Dec 15, 2010 at 8:59 PM, a bv <vbavbalist@gmail.com> wrote:
> Hi,
>
> I want to write a script which will run a command *that gives some
> written information and needs to press enter key to go on keyboard.
> Then it will ftp its output etc.
>
> How can i easily make this enter key issue on the script?


If you're trying to automate what is usually an interactive process I
think you'll have to use something like 'expect' or a derivative
thereof, such as the perl or python expect modules.

Google should help you out with this.


--
Romeo Theriault
System Administrator
Information Technology Services

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 12-15-2010, 11:49 AM
Lincoln Fessenden
 
Default Using enter key in bash script

On 12/15/10 6:59 AM, a bv wrote:

Hi,

I want to write a script which will run a command that gives some
written information and needs to press enter key to go on keyboard.
Then it will ftp its output etc.

How can i easily make this enter key issue on the script?

Regards


#!/bin/bash
echo "Press Enter"
read result

--
Lincoln Fessenden
Linux Systems Administrator
215-503-0986

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 12-15-2010, 02:15 PM
Nigel Wade
 
Default Using enter key in bash script

On 15/12/10 11:59, a bv wrote:
> Hi,
>
> I want to write a script which will run a command that gives some
> written information and needs to press enter key to go on keyboard.
> Then it will ftp its output etc.
>
> How can i easily make this enter key issue on the script?
>
> Regards
>

Another option, if there's a lot of info, is to pipe the output through
'less' so it gets paged. Maybe add the '-e' option so that enter will
exit less rather than the default of having to use 'q'.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 12-15-2010, 02:23 PM
John Bolton
 
Default Using enter key in bash script

If you are using bash simply use the read statement. For example:


#!/bin/bash

echo -e "
Demonstration text.
"
echo -n "Press ENTER to continue"
read


John

-----Original Message-----
From: redhat-list-bounces@redhat.com [mailto:redhat-list-bounces@redhat.com] On Behalf Of a bv
Sent: Wednesday, December 15, 2010 4:00 AM
To: redhat-list@redhat.com
Subject: Using enter key in bash script

Hi,

I want to write a script which will run a command that gives some
written information and needs to press enter key to go on keyboard.
Then it will ftp its output etc.

How can i easily make this enter key issue on the script?

Regards

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 

Thread Tools




All times are GMT. The time now is 06:52 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org