Thomas: My solution to the the differences in Unix tools across platforms is often to use Perl. In your example,
echo "kaka pipi" | perl -p -e 's/\S/./g'
produces the correct output, and in my experience, Perl works the same whether I’m running it on Solaris, various Linux distributions, or OS X. After months of working with a frustrating mix of tools such as sed, awk, tr, etc. in bash scripts at my last job, I started advocating Perl as a general scripting tool instead of bash + small tools. It was unpopular with some at first, but the benefits became clear. We only had to know one regular expression syntax. We didn’t encounter issues with size limitations on some platforms such as AIX with tools like grep. Our scripts took less time to write and even less time to debug. I also wrote a small essay and reference guide to aide in transition.
I actually dislike Perl for complex applications, but I do think it’s a great general purpose scripting language.
Tags: Perl










July 23rd, 2004 at 11:04 am
I concur.