Tuesday, September 16, 2008

Unlearning bash

At debian's IRC someone asked how to replace ***.png to ***.jpg. To which I replied a "bashism."
Fortunately someone else corrected my bash-istic ways on time.

So how to unlearn those pesky bash-ways? It seems the IEEE comes to our rescue with the Open Group Specification.

Other tools seem to be debian's checkbashism command and the ol' technique of using dash instead (with some dose of cursing in between ^_^).

Update: It is a bashism to use the nifty regexp substitution

${var/\.oldext/.newext}

One should instead use the standard way of cutting trailing substrings from a var:

${var%.oldext}.newext

No comments: