Index ¦ Archives ¦ Atom

Fun with Bash and Ruby

I got bored while I was paying bills so I decided that I wanted to automate a bill that doesn't have a very good automatic payment method. I decided to use Ruby and Mechanize to perform the task. Since I don't want the script just hanging around with my customer or my credit card information, I decided to pass those values into the script from the command line. To avoid leaving my password and credit card number in the history file, I learned about HISTIGNORE. This little gem is pretty easy to use but it basically ignores any line that matches the commands separated by a colon.

A default that I found on Using Bash's History Effectively was to use something like:

export HISTIGNORE="&:ls:[bf]g:exit"

He also suggested to add [ \\t]* to allow for keeping any command starting with a space or tab out of the history. I'll definitely be using this and now I just have to remember to use a space.

© Steve Spigarelli. Built using Pelican. Theme by Giulio Fidente on github.