?

Log in

No account? Create an account

Previous Entry | Next Entry

Simulating "show" command

This is very important while one configure snmp simulator "mimic" for telnet.

Here is one script to simulate "show" command, important, simple though.

#!/bin/sh
#show

count=0
FILE=./telnet/

for arg in $*
do
count=`expr $count + 1`
    if [ $count -lt $# ]
    then
        FILE="$FILE"$arg"_"
    else
        FILE="$FILE"$arg
    fi
done
cat $FILE.txt


A Sample run:

[jadu@GILBERT] Happy $ ./show ospf neighbor
cat: ./telnet/ospf_neighbor.txt: No such file or directory

So actual "show ospf neighbor" output is to be kept in the file ./telnet/ospf_neighbor.txt.

 

Profile

jaduks
Jadu Kumar Saikia

Latest Month

January 2008
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  
Powered by LiveJournal.com
Designed by chasethestars