Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Unix <return> command in script

Thread Tools
 
Search this Thread
 
Old Mar 21, 2007 | 04:50 PM
  #1  
T4molie's Avatar
T4molie
Thread Starter
Scooby Regular
 
Joined: Dec 2002
Posts: 2,617
Likes: 0
From: Dum dum de dum....
Question Unix <return> command in script

Guys,

does anyone know if it is possible to tell a linux script to do a <return key> function?

for eg.....

./bin/myscript.s
<return>

Andy
Reply
Old Mar 21, 2007 | 05:11 PM
  #2  
stevem2k's Avatar
stevem2k
Scooby Regular
 
Joined: Sep 2001
Posts: 4,670
Likes: 0
From: Kingston ( Surrey, not Jamaica )
Default

but

#!/bin/sh

/usr/bin/somecommand

#EOF


Will run the 'somecommand' within a script ...

Or have I missed something in the question ?
Reply
Old Mar 21, 2007 | 05:15 PM
  #3  
T4molie's Avatar
T4molie
Thread Starter
Scooby Regular
 
Joined: Dec 2002
Posts: 2,617
Likes: 0
From: Dum dum de dum....
Default

Steve,

The myscript.s is calling an imaging program which in turn is re-imaging the pc but when it has finished it is dropping out and asking for a proxy ip address and press return. Once the user presses <return> it finishes.

And You're right I forgot to put the #!/bin/sh at the beginning of it - durrr!

Andy
Reply
Old Mar 21, 2007 | 05:34 PM
  #4  
stevem2k's Avatar
stevem2k
Scooby Regular
 
Joined: Sep 2001
Posts: 4,670
Likes: 0
From: Kingston ( Surrey, not Jamaica )
Default

Ah,

you want an expect script...

Expect - Wikipedia, the free encyclopedia

or

Expect - Expect - Home Page


Really useful for automating interactive stuff..
Reply
Old Mar 21, 2007 | 05:44 PM
  #5  
T4molie's Avatar
T4molie
Thread Starter
Scooby Regular
 
Joined: Dec 2002
Posts: 2,617
Likes: 0
From: Dum dum de dum....
Default

Nice one cheers fella.... will start reading
Reply
Old Mar 21, 2007 | 05:51 PM
  #6  
MrShades's Avatar
MrShades
Scooby Regular
 
Joined: Aug 2002
Posts: 1,167
Likes: 0
From: Sunny Swindon
Default

...and (it's years since I've done any Unix shell scripting, so excuse me if way out).... isn't the easy way just to:

#!/bin/sh

/usr/bin/myscript.s < return.key


and then use vi or summut to create a file called 'return.key' that just contains one or more carriage-returns.

That's certainly what I used to do, or something similar, in the good 'ol days!
Reply
Old Mar 21, 2007 | 06:03 PM
  #7  
T4molie's Avatar
T4molie
Thread Starter
Scooby Regular
 
Joined: Dec 2002
Posts: 2,617
Likes: 0
From: Dum dum de dum....
Default

Have sorted it.... modified a settings file and gave it a duff Proxy IP Address.

It's a SUSE Linux boot CD that we're making to re-image a users laptop.

Cheers for the replies

Andy
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
the shreksta
Other Marques
26
Oct 1, 2015 02:30 PM
vmax
Non Scooby Related
4
Oct 23, 2001 01:38 PM
Puff The Magic Wagon!
Non Scooby Related
4
Oct 1, 2001 05:33 PM
druddle
Non Scooby Related
5
Sep 21, 2001 09:47 AM




All times are GMT +1. The time now is 04:17 AM.