From: Roger B. <ro...@ro...> - 2004-03-15 19:59:50
|
> Not really. I've been dealing with cross-platform Unix issues for most > of my career, and know how to write a portable Bourne shell script that > you can expect to run pretty much anywhere. Me too! I used to work on machines that had multiple universes (as they called it). You could have a sysv environment or a bsd environment with commands scattered between them, and lots of other fun issues. > Sed and awk are always safe. They may always exist, but they don't necessarily always run with non-trivial data. Things like arbitrary limits on line length (such as 512 or 1024 chars), breaking on any files not having UNIX end of lines, limits on the number of variables etc. > The main > challenge is recognizing and avoiding shell features that are bash- or > ksh-specific. You might be surprised how much you can still do within > these limitations. Heck, I still don't use shell functions except when I occassionally remember they exist :-) I ended up writing a macro system in TCL that had a library of shell code, and then expanded it for the main shell scripts. It turned out to be very useful as there is so much stuff that doesn't work between machines, even modern ones (for example try killing one of your own processes named foo, or finding out how much free disk space there is for a proposed directory name). > (Not a terribly vital job skill nowadays, unfortunately.) It isn't the skill that matters, but more the way of thinking that does. I am glad that a lot of these lower level issues are non-issues any more, while the thinking is still very relevant. For example here is another great programmer complaining about the very same issue: http://www.joelonsoftware.com/articles/PleaseLinker.html Roger |