Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Looking for help with shell scripting
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
YamahaRacer
n00b
n00b


Joined: 22 Jun 2002
Posts: 4
Location: The Motor City

PostPosted: Mon Jun 24, 2002 10:02 pm    Post subject: Looking for help with shell scripting Reply with quote

OK, here's the scoop. I'm new to shell scripting, but I'd like to try my hand at it. I've found my first task, but try as I might I get the darn thing working. I have to access different ports on a 16 port annex server. To do said task I have a small executable binary program. The program basically opens a new terminal window telnets to the correct IP/PORT address and refreshes the terminal to prevent hangup. To use this program I have to enter the following:

$open_port
c(cmd line) s (shell)
>s
enter IP address:
>155.128.258.79
would you like to open all 16 ports [Y N]
>N
please enter the ports you would like to open [i.e. 7 8]
>4 4
$

What I'd like is a shell script that sends the open_port command, s, IP address, N, and lets me enter the ports I'd like to have opened. Ive tried:

open_port | s

but to no avail. Any help would be greatly appreciated. Thanks
_________________
Mahalo


Last edited by YamahaRacer on Tue Jun 25, 2002 12:18 am; edited 1 time in total
Back to top
View user's profile Send private message
mksoft
l33t
l33t


Joined: 28 May 2002
Posts: 844

PostPosted: Mon Jun 24, 2002 10:48 pm    Post subject: Reply with quote

Try to save the commands to a text file and redirect open_port's input to the file, e.g:

Code:
open_port < _file_name_containing commands_

_________________
There's someone in my head but it's not me - Pink Floyd
Back to top
View user's profile Send private message
YamahaRacer
n00b
n00b


Joined: 22 Jun 2002
Posts: 4
Location: The Motor City

PostPosted: Tue Jun 25, 2002 12:19 am    Post subject: Looking for help with shell scripting Reply with quote

That did the trick. Thanks a lot.
_________________
Mahalo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum