Respond to Prompt in Bash Script
I work on a project that requires I frequently build and destroy a virtual machine. I don't enjoy having to do so but virtual machines can be notoriously difficult to prop up, especially when you have a complex app living within it.
Manually typing the same commands over and over can be mind-numbing so I've create a bash script to handle all of the work for me. One hiccup to the process is needing to confirm removal of an existing virtual machine; using a pipe and
echo allows me to answer the prompt:
# ... some directives here
# Remove the machine, confirming "y" when asked by docker-machine
echo 'y' | docker-machine rm default
# ... more directives here
echo I pipe a
y response to
docker-machine's confirmation prompt, thus allowing the script to move forward with other tasks without the need for manual intervention.
I don't, however, know how to handle multiple prompts -- can you tell me and everyone else?
It's no secret that Facebook has become a major traffic driver for all types of websites. Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate websites directly. And of course there are Facebook "Like" and "Recommend" widgets on every website. One...
One of the most rewarding experiences of my life, both financially and logically, has been buying and managing cryptocurrencies like Bitcoin, Litecoin, Ethereum. Like learning any other new tech, I made rookie mistakes along the way, but learned some best practices along the way. Check out...
We've all inherited rubbish websites from webmasters that couldn't master valid HTML. You know the horrid markup: paragraph tags with align attributes and body tags with background attributes. It's almost a sin what they do. That's where dwMarkupMarine comes in.
Last week I covered a smooth, subtle MooTools effect called Kwicks. Another great MooTools creation is the Accordion, which acts like...wait for it...an accordion! Now I've never been a huge Weird Al fan so this is as close to playing an accordion as...