Brace expansion to match multiple files in Bash

Bash has handy brace expansion powers that I've belatedly discovered. $ echo I love hippo{griffs,potamuses,dromes} I love hippogriffs hippopotamuses hippodromes For example, you can quickly diff a file with and without a suffix: $ echo diff .env{,.example} diff .env .env.example Or tail multiple log files: $ echo tail -f /var/log/{messages,secure} tail -f /var/log/messages /var/log/secure Bash … Continue reading Brace expansion to match multiple files in Bash

libdb2.so.1: cannot open shared object file

I got this error starting a ruby application: /usr/local/rvm/gems/ruby-1.9.3-p547/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require': libdb2.so.1: cannot open shared object file: No such file or directory - /usr/local/rvm/gems/ruby-1.9.3-p547/extensions/x86_64-linux/1.9.1/ibm_db-2.5.11/ibm_db.so (LoadError) An .so is a Linux library, equivalent to a .dll on Windows or a .dylib on Mac. Note that there are two different libraries mentioned. ibm_db.so is present, while libdb2.so.1 is … Continue reading libdb2.so.1: cannot open shared object file

The specified bucket is not S3 v2 safe

I ran into this error when running ec2-upload-bundle:The specified bucket is not S3 v2 safe (see S3 documentation for details)This was due to uppercase letters or underscores. Later I also ran into an issue with periods in bucket names which showed up as this error message:ERROR: Error talking to S3: Server.AccessDenied(403): Access DeniedHere is an … Continue reading The specified bucket is not S3 v2 safe

Have bash warn you about uninitialized variables with set -u

By default, Bash treats uninitialized variables the same way as Perl -- they are blank strings. If you want them treated more like Python, you can issue the following command in your bash script: set -u You will then start seeing warning messages like the following: ./my_script.sh: line 419: FOO_BAR: unbound variable Note that this … Continue reading Have bash warn you about uninitialized variables with set -u