bash

Bash: Test if argument is an integer

I haven't blogged as much as I used to, here's hoping I find some time to keep this up :-)

Something I always have to look up in older code is how to test if an argument is numerical. This can be useful for a function that optionally accepts something like a return-code, but also accepts a long string (eg. an error message). Putting the return-code at the end of a long string is far from developer-friendly and the error-message doesn't have to be single string.