shell file descriptor programming (was: Unlinked temp files)

Steve Rudek stever at tree.UUCP
Tue May 2 11:15:41 AEST 1989


In article <10944 at bloom-beacon.MIT.EDU>, scs at adam.pika.mit.edu (Steve Summit) writes:
> In article <1015 at philmds.UUCP> leo at philmds.UUCP (Leo de Wit) writes:
> >main(argc,argv) int argc; char **argv; { lseek(atoi(argv[1]),0L,0); }

> be more general and write lseek(1) instead of rewind(1S):
> 	extern long int atol();
> 	main(argc, argv) int argc; char *argv[];
> 	{lseek(atoi(argv[1]), atol(argv[2]), atoi(argv[3]);}

Neither works under the ksh (Microport System V/AT 2.4) though both work
under the bourne shell (tested with the shell script).  The ksh failure is
absolutely silent.

Obviously the ksh isn't 100% compatible (I've also noticed that function
recursion which works under sh fails under ksh--but at least it has the
decency to complain).  Is this sort of file rewind impossible under ksh?
Any guesses as to why the ksh falls down?  Other significant upward
incompatabilities?
-- 
----------
Steve Rudek  {ucbvax!ucdavis!csusac OR ames!pacbell!sactoh0} !tree!stever



More information about the Comp.unix.wizards mailing list