1838576 Members
4272 Online
110128 Solutions
New Discussion

Script problem

 
SOLVED
Go to solution
Kenn Chen
Advisor

Script problem

Currently, I've created a script to manipulate the lanadmin command. First i login to lanadmin and type lan and display to view the inbound octets value. This is the script :-

lanadmin << EOF
lan display
?? ===> I need a key here. How ??
clear
?? ===> I need to get the inbound octets
value. How ??

I wish to get the value every mins. Any idea.
Thanks.
Cyber Zen
4 REPLIES 4
Philip Chan_1
Respected Contributor

Re: Script problem

Maybe "EXPECT" can help,

http://expect.nist.gov/

Expect is a tool for automating interactive applications such as telnet, ftp, passwd, etc. And of course it should work for lanadmin as well.

~Philip
Uffe Gavnholt_1
Honored Contributor

Re: Script problem

if you make an input file to use with your script, let's call it input

in vi you specify everything normally, where a return is simply a new line.

If you want the actual value of a key specified in vi, you can in input mode press ^V followed by the key you want represented as the value.

next use the input file as:

lanadmin < input

Good luck

Uffe
Danny Engelbarts
Frequent Advisor
Solution

Re: Script problem

Chen,

This should work;

lanadmin << !EOF 2>&1 | grep "Inbound Octets"
lan display

q
!EOF

Greetz, Danny
Kenn Chen
Advisor

Re: Script problem

Thanks. Could you pls to explain the script that you given such as << 2 &1 'cos i dun have any script background. thanks.
Cyber Zen