Unix deficiencies/problems
Jeffrey Kegler
jeffrey at algor2.UUCP
Mon May 8 10:27:00 AEST 1989
In article <2656 at mentor.cc.purdue.edu= mjs at mentor.cc.purdue.edu (Mike Spitzer) writes:
=In article <424 at algor2.UUCP> jeffrey at algor2.UUCP (Jeffrey Kegler) writes:
==I miss very little from the IBM world, but the availability of formal file
==names is one of them.
=
=The Bourne shell and other reasonably sh-compatatible shells (like
=ksh) allow the redirection of any file descriptor, not just stdin,
=stdout, and stderr. You can have the shell open these file
=descriptors for your program and have "formal files" as you describe
=above. To use your example, you could:
=
= application <input >logfile 2>errs 3<db1 4<db2 5>rep1 6>rep2
=
You probably have not seen the above technique used very often, and for
good reason. It requires you to know the order in which the files were
opened, which is rather a subtle property to make a shell script depend on.
That is why only descriptors 0, 1 and 2 are usually used. The environment
opens them for the application, in well known order, and few applications
override the environments choices.
--
Jeffrey Kegler, President, Algorists,
jeffrey at algor2.UU.NET or uunet!algor2!jeffrey
1762 Wainwright DR, Reston VA 22090
More information about the Comp.unix.questions
mailing list