Shell Script Args Parsing

by @jehiah on 2011-03-04 12:18UTC
Filed under: All , Articles , Programming , Shell , Linux , SysAdmin

At bit.ly we find that having a good way to specify command line arguments goes a long way to writing self-documenting code. We use tornado.options for our python scripts because it helps simplify the way command line arguments are specified.

We realized there was a need to do something similar with our shell scripts that we use to automate system tasks, and @lintzston helped come up with this pattern which is awesome for it’s simplicity, and how clean shell script the code reads. (if you have done any shell scripting, you know that readable shell scripts are elusive.)

Subscribe via RSS ı Email
© 2023 - Jehiah Czebotar