Blog

Bash Hack - Testing to see if a variable is an integer

Bash unfortunately does not include a built-in function to test if a variable is an integer. There is however a simple pattern matching hack that you can use to test this on your own:

Check for Unsigned Integer

[[ $number =~ ^[0-9]+$ ]] && echo -e "match found : integer\n"

Check for Signed Integer

[[ $number =~ ^[+-]?[0-9]+$ ]] && echo -e "match found : (signed) integer\n"

Script to list all of the days between two dates

Occasionally I need a list of valid days between two dates. In the past, I either generated this list manually or I hacked something else together to get the job done. This week, I found myself in a situation where I needed to do this task once again so I created a simple bash script to automate this process.

RSS - The Modern Newspaper

rssLike a newspaper, RSS (Really Simple Syndication) allows you to stay up-to-date with the latest news by compiling information from many different sources and presenting it in a way that is easy for you to read. You can easily skip over articles that don't interest you, read longer articles later, or you may even read only the sections that are of interest to you at that time.

RSS Readers only collect information from the sources that you have subscribed to. You no longer have to sift through 'finance', 'politics', and 'weather' to find 'technology' and 'comics' (or vice versa if that's what interests you).

Dropbox - Online backup, file sync, and sharing made easy.

dropboxDropbox is the easiest way to store, backup, sync, and, share files online. Simply put your files into your Dropbox on one computer and they are instantly available on any of your other computers that also have Dropbox installed (Windows, Mac, and Linux too!). Because copies of your files are stored on Dropbox's secure servers, you can also access them from any computer or mobile device using the Dropbox website.

The free Dropbox account comes with 2GB of space that you can use for as long as you like. Need more than 2GB of space? Dropbox offers up to 100GB plans to meet all your sync and sharing needs.

Pages

Subscribe to RSS - blogs