Use long flags when scripting
While it is generally a good idea to write readable code, it is also true that long flags are not universally supported, and the short flags don't always have the same meanings (or even exist!) across different systems.<p>This is an interesting conundrum. As has been pointed out, POSIX specifies standard options (which are all short):<p><a href="http://news.ycombinator.com/item?id=5165058" rel="nofollow">http://news.ycombinator.com/item?id=5165058</a><p>But these are not universally supported:<p><a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?ps" rel="nofollow">http://unixhelp.ed.ac.uk/CGI/man-cgi?ps</a><p>What to do? My proposal: do what we do in the C/C++ world when presented with portability problems: abstract it away. POSIX sh supports functions, which can be named appropriately for readability, while calling the proper arguments and commands for different platforms. To avoid unnecessary duplication of platform/argument detection, setup could be done in a function called before anything else to create variables with the appropriate command names and arguments.<p>This may all seem too involved, but realize that we are talking about creating robust software that is to be maintained, so applying proper software engineering principles seems appropriate.