For those of you who don;t follow my other blog, I’m in Barcelona at the moment. I’m here to learn Spanish and chew bubblegum. And I’m all out of bubblegum, etc. Anyway, Linux let me get in touch with my dad. The short story is (if you want long walls of text, read my bit [...]
Posts Tagged ‘useful’
Count Arguments In A Bash Script
Another useful tip I’m sure most people will be familiar with, but in bash scripts $# stores the number of arguments passed to the script. Eg, combine with $@ (all arguments) for batch processing (what I used it for): foreach $arg in $@; do [stuff] [compare with $# to tell remaining items] done Very basic [...]
Recent Comments