Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Alright I'm drawing a blank here but I know I used to run some linux command that would automatically generate a shell script for me based on how i interacted with the shell. Example: If i remember right i would prefix my command id like to run with the command i'm trying to remember and it would automatically build my shell script based on the filename i gave it to output. Like this...

<command> telnet "whoever" > file.sh  

I dont know if that's how i use to run it but i think it was close.

The command logged the telnet session and based on my input of username and password it generated a script automatically based on that criteria I typed. This was just one example that i used it for. It was a good command to save time in writing a script to automate certain things that required user intervention.

Anybody know what im talking about? Im pretty sure its a standard linux command but last time i used it was probably ten or twelve years ago before Ubuntu, when Red Hat was still just Red Hat

share|improve this question
    
script will do that, if I'm understanding your question correctly :) –  Caesium Feb 22 '12 at 4:07
    
Hm or maybe not, perhaps you're thinking of a chatscript, like what's used to login to a PPP session and similar? –  Caesium Feb 22 '12 at 4:19
    
Not the one i was looking for. I used it to automatically generate a script when i was ftp'ing to alot of different web servers i was hosting to grab some log files off of each one. Since the machines had different OS's the logins were different meaning the interaction was different. Which meant my expect statements in my script had to be different for each automated login to work. I would run this command im trying to remember and then login to each box and grab what i needed. When i was done it had already logged the entire session based on my input and made a script for entire process –  Scott Stookey Feb 22 '12 at 4:26
    
@Caesium PROBLEM SOLVED!!! Ok i found it. I had to download it but the command is autoexpect. It automatically generates an EXPECT script by watching the entire process. Example: autoexpect -f autologin.sh telnet 192.168.1.1 This will automatically build a script for me called autologin.sh and automate everything that i previously just did in the telnet session. Thank you for your help anyways. –  Scott Stookey Feb 22 '12 at 4:57
    
@ScottStookey: If that is the solution, you can add it as an answer and accept it. –  Richard Holloway Feb 22 '12 at 9:39

1 Answer 1

up vote 2 down vote accepted

PROBLEM SOLVED!!! Ok i found it. I had to download it but the command is autoexpect. It automatically generates an EXPECT script by watching the entire process. Example: autoexpect -f autologin.sh telnet 192.168.1.1 This will automatically build a script for me called autologin.sh and automate everything that i previously just did in the telnet session. Thank you for your help anyways.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.