Unix deficiencies/problems
Barry Margolin
barmar at think.COM
Sat May 6 11:32:02 AEST 1989
In article <17327 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
Describing how to use shell variables as a substitute for logical file names:
>$ joe=/home/orion/jsmith/projectA/speech
>$ splib=/home/magellan/tjones/lib/splib.a
>$ cd $joe
>$ ls $joe
>$ ar t $splib
>$ cc args -l$splib
That's fine if the file name is passed in on the command line. But
what if a program prompts for a file name? For instance, when
specifying files in an editor's read or write command.
On Multics, my solution to this would have been to take advantage of
dynamic linking. All Multics programs that take file names must call
expand_pathname_ to parse a pathname into an absolute directory
pathname and a directory entry name. It's a simple matter to place a
personalized version ahead of the standard one in one's linker search
path (in fact, I did just this, although not for the above use,
although I know people who did the above). Now SunOS has dynamic
linking, so perhaps open(2), chdir(2), etc., could be replaced this
way; however, programs don't have to be dynamically linked, so you
would end up with a situation where logical file names are recognized
by some commands and not by others, depending only on how they were
built. Also, this would have problems if shell wildcard expansion
returned a name that happened to match a logical name (wildcards
should generally be processed AFTER expanding logicals).
Barry Margolin
Thinking Machines Corp.
barmar at think.com
{uunet,harvard}!think!barmar
More information about the Comp.unix.questions
mailing list