On Portable Software
Software portability isn’t much of an issue nowadays; standard APIs (like Win32 and POSIX), virtual machines (Java, .NET/Mono), and interpreted languages (like Ruby, Python, Perl, and PHP) mean that whatever your chosen platform, you probably don’t need to worry too much about it.
This site is generated by three shellscripts and a makefile. I originally wrote
them on Debian, using GNU make and coreutils. Then, I attempted to port
them to FreeBSD, with Berkeley make and userland.
Big mistake.
- GNU
stattakes a long option--formatto specify the output format. BSDstattakes a short option-finstead. GNUstatapparently does have a short option for it as well:-c. Your guess is as good as mine. - The format specifications for the two versions of
statbear no resemblance to one another whatsoever. - GNU
datehas an option-rto display the last-modified time of a specified file. BSDdateuses-rto indicate that it should interprete the following number as seconds since epoch, and print the corresponding date.- Actually, that’s something I’ve missed in GNU
date, especially since the GNU version’s replacement feature is just a duplication ofstat’s functionality.
- Actually, that’s something I’ve missed in GNU
- GNU
sedhas some crazy extensions that aren’t in BSDsed, that I suspect were coded by the crack-smoking monkeys of Gnome fame. - BSD
headdoesn’t let you specify relative to the end of the file like GNUheaddoes (e.g. print all but the last two lines), although BSDtailhas the equivalent (e.g. all but the first two lines). - rms scares small children.
I’d really like to make it portable, at least between BSD and GNU, but it looks like it may be a bugger to do so.