UUCP files/directories being removed under SCO UNIX

Leslie Mikesell les at chinet.chi.il.us
Fri Jun 8 01:52:04 AEST 1990


In article <1095 at sixhub.UUCP> davidsen at sixhub.UUCP (bill davidsen) writes:

>  This ugly shell script:
>
>| 		cd /usr/spool/uucp
>| 
>| 		for i in *
>| 		do
>| 			cd $i
>| 			.
>| 			cleanup code
>| 			.
>| 		done

>  Any competent programmer would write 
>        cd $i || continue
>to insure that if the cd failed everything would fail cleanly.

Perhaps any competent programmer that knew about ksh and its
incompatibility with /bin/sh.  I suspect that at the time that
script was writtten, competent programmers knew that /bin/sh would
exit if a cd fails (a wise default, in my judgement).

>[...] but the idea is that good programmers
>put error checking in their scripts, *and comments too!!* I don't find
>SCO any worse than anyone else on this, although they did still have "^"
>instead of "|" in some of the schell scripts which come with their text
>system. This makes them fail with ksh, and I reported it over a year
>before I bought my last text set.

I'd put the blame on the authors of ksh for the incompatibilites, or
whoever decided to use ksh to run scripts written for /bin/sh.
Another annoying incompatibility is that "su -c user script" will
execute user's .profile if user's login shell is ksh, but not with sh. 
This can cause surprising behaviour when the command is run by cron,
the .profile has interactive commands, and the user changes his shell.

Les Mikesell
 les at chinet.chi.il.us



More information about the Comp.unix.i386 mailing list