First things first, I'm very new to bash scripting.
Well, I have a bash script to start the creation of a loopback server. Which does some bash commands, then runs 'expect' which then starts a program called wadm (expect handles the password wadm prompts for).
here's a quick overview:
- do some bash cmds (prompt for username/pass)
- compute some stuff
- start expect shell within bash
- expect starts the wadm with specific username
- wadm prompts for password
- expect enters the password
- expect runs the wadm-specific cmds
- quit wadm (with expect sending 'quit' to wadm')
- quit expect (expect ends within bash script)
- expect starts the wadm with specific username
- edit some files that the above wadm cmds created
- start expect shell within bash
- expect starts the wadm with specific username
- wadm prompts for password
- expect enters the password
- expect runs the wadm-specific cmds (different cmds that rely on previous wadm cmds)
- quit wadm (with expect sending 'quit' to wadm')
- quit expect (expect ends within bash script)
- expect starts the wadm with specific username
What I want to do is keep expect and wadm running in the background (as to not start/quit wadm every time I need to do something in it) while I do some other stuff in bash.
Being new to bash scripting (also, I'm not that advanced in linux/unix) I thought of using job control to approach this, but according to this post (http://stackoverflow.com/questions/690266/why-cant-i-use-job-control-in-a-bash-script) job control is probably not the way to go. What other options are there for this kind of process?