Shell script to telnet and run commands
Solved/Closed3 responses
                
        
                    netgear5
    
        
                    Posts
            
                
            8
                
                            Registration date
            Saturday October  4, 2008
                            Status
            Member
                            Last seen
            April 27, 2009
            
            
                    29
    
    
                    
Nov 12, 2008 at 05:58 AM
    Nov 12, 2008 at 05:58 AM
                        
                            
                    hey buddy this is a great thing that you have posted here. thks for the help and hope that will here very somme with some useful tips like that.
                
                
             
        
    
    
    
    
May 15, 2009 at 04:24 AM
spawn telnet <machine ip>
expect "login:"
send "<username>\n"
expect "Password:"
send "<password>\n"
send "bash\n"
send "cd /opt\n"
send "ls -ltr\n"  (if you are not giving \n then it will wait for your response or u have to type enter manually).
interact
How to execute the “expect“ command expect –f <file name>
Ex: expect –f <filename>.expect