A suggestion: .... == ../../..

Bruce G. Barnett barnett at vdsvax.steinmetz.ge.com
Tue Apr 19 21:22:08 AEST 1988


In article <75 at vertical.oz> greg at vertical.oz (Greg Bond) writes:
|This generalises: . = current dir, .. = parent dir, ... = grandparent etc.
|
|This could be done in the shells (but only in restricted cases,
|similar to ~expansion). It would more usefully be done in the kernel
|routine (namei?) that maps names to inodes (where the symbolic links
|are traversed).

The beauty of the current implemenetation is that the file system
does most of the work. That is, the files '.' and '..' are really
there.

	ANY process can make use of those files. 

You can always put the files '...' and '....' in there if you wish.
True - this would need some sort of kernel mod if you wanted mkdir(2)
to automagically add those files.

I think there are better ways of being lazy - myself. 

Csh example 1:

	alias '..' 'cd ..'
	alias '...' 'cd ../..'
	alias '....' 'cd ../../..'

Csh example 2: use cdpath

	set cdpath = ( .. ../.. ../../.. )

then when you type
	cd a
the system will check for
	./a
	../a
	../../a
	../../../a

Quote for the day: "If's you're lazy, don't modify the kernel' :-)
-- 
	Bruce G. Barnett 	<barnett at ge-crd.ARPA> <barnett at steinmetz.UUCP>
				uunet!steinmetz!barnett



More information about the Comp.unix.wizards mailing list