Intuitive Japanese Calligraphic Ideogram Intuitive Systems: Leadership for the 21st Century: online strategies and communications

The Business Blog at Intuitive.com

Dave Taylor
Dave Taylor has been involved with the online world since 1980 and is recognized globally as an expert on both technical and business issues. He has been published over a thousand times, launched four Internet-related startup companies, has written twenty business and technical books and holds both an MBA and MS Ed. He's a columnist for the Boulder Daily Camera and Linux Journal and frequently appears in other publications both online and in print. Additionally, Dave maintains four weblogs: The Business Blog at Intuitive.com, Ask Dave Taylor, Dave On Film, and GoFahterhood. Based in beautiful Boulder, Colorado, Dave is an award-winning speaker, sought after conference and workshop participant and frequent guest on radio and podcast programs, as well as active member of his community and busy single father to three children.

The hassle of standards

Alright, so I just finished my Solaris book and now I'm working on the other book in the queue, Unix Shell Hacks. We're in the revision phase now and an interesting question has arisen regarding the variation in shells on different Unix platforms. Specifically, I've been asked by some tech reviewers to tweak my scripts to make them more Posix compliant, but there's an obstacle in the way: Solaris.

Ah, the bitter taste of irony, eh? After testing some basic Posix shell constructs across a wide variety of Unix and Linux operating systems, I have ascertained that Solaris is the only Unix OS that doesn't have a Posix-compliant shell. The only one! And that's the very latest Solaris 9 distribution.

I tested the following basic Posix constructs:

constructexplanation
$(xx)The modern alternative to backquoting arguments, used like this: echo today is $(date)
$((a+b))A shell built-in that's a faster alternative to the incessant calls to expr. Can be used like this: four=$((2+2))
${x#?} and ${x%$y}String slicing operations, these replace either calls to cut or (my preferred alternative, actually) the Bash ${x:y:z} mechanism.

What makes this a tremendous drag is that now we have a dilemma with the book, thanks to Sun not keeping up with their OS (imagine! They have an R&D budget far beyond any Linux company, and yet...). Do we write the scripts to work universally, even though they're creaking antiques and examples of bad style, or do we write them for Posix-compliant Unixes and have a sticker on the front saying "Not for Solaris!" or similar??

For the record, I tested FreeBSD, NetBSD, Mac OS X, Red Hat Linux 6, 7 and 8, Debian Linux, Mandrake Linux, WinXP (ksh Posix shell), HP-UX and Solaris 6, 8 and 9. Only the Solaris /bin/sh couldn't work with the constructs listed in the above table.

Posted by Dave Taylor at March 12, 2003 2:23 PM

Comments
There are no comments on this article yet.
Insider's Guide to Blogging
Before you leave a comment, a tip: If you're interested in blogging, you should sign up for my Blogsmart News so you can stay up to date on the latest insider tips and ideas for your Internet business and marketing efforts. Sign up right now and you'll get a free copy of my "Insider's Guide to Blogging" ebook too!
 
Post a comment




Because I value your thoughtful opinions, I encourage you to add a comment to this discussion. Don't be offended if I edit your comments for clarity or to keep out questionable matters, however, and I may even delete off-topic comments.



RDF XML GeoURL Add to My Yahoo!

Valid CSS!