== What System V did to the poor _ln_ command On V7, UCB BSD 4.x, SunOS 2.x, 3.x and 4.x, the [[*BSDs|]], Linux, and anything using GNU fileutils: > ; touch a b > ; ln a b && echo oops > ln: b: File exists On System V, including Solaris 8: > ; touch a b > ; ln a b && echo oops > oops That's right: the System V version of _ln_ goes to significant extra work over just calling _link(2)_, and in the process is so unhelpful that people had to make a new utility called _[[link http://www.opengroup.org/onlinepubs/009695399/utilities/link.html]]_ to do the right thing. (Fortunately, this behavior is no longer SuS compliant, per the [[ln spec http://www.opengroup.org/onlinepubs/009695399/utilities/ln.html]].) This is one of those things that sticks in my mind, because I had the distinction of being the first person to try to run CNews on a System V machine. CNews has a lot of shell scripts and had been developed on V7 and BSD systems, so all of the shell scripts did their locking with '_ln temp LOCK_'; the consequences of the locking not actually working were reasonably spectacular and quite memorable. Fortunately the machine wasn't being used by anyone else at the time. (The authors of CNews were as appalled as I was, and promptly introduced a little _newslock_ program and switched the shell scripts to using it, so they had behavior they could count on.) I was reminded of this mess recently when I wrote a shell script that needed to both do locking and run on our Solaris 8 systems. I was reasonably displeased to discover that Solaris 8 still has this bit of braindamage.