streamline development with autoexpect

expect is one of the old UNIX tools that people seem to continually rediscover. It is a hole plugger, linking together other tools to do things that you just can’t do any other way, or at least, not without some serious coding.

I am continually deploying and undeploying IPA Server as part of my development. Installing requires, amongst other things, typing in a password at least four times. I was sick of typing it, and decided to turn to expect.

I’m lazy. I didn’t want to learn another Domain specific language. So, while procrastinating by reading man pages and such, I cam across a tool that made my life much easier.

autoexpect

It is basically a macro recorder for the bash shell.  I ran

autoexpect

ipa-server-install –uninstall

And ran through the install process. When I was done, typed exit, and there was a beautiful expect script all ready for me in script.exp.  renamed it t ipa-uninstall.exp.  Same thing for the install process.

I should rarely, if ever have to type those passwords again.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.