Hard links vs. Soft links

Bob McGowen x4312 dept208 bob at wyse.wyse.com
Fri Aug 24 12:25:17 AEST 1990


In article <13646 at ulysses.att.com> swfc at ulysses.att.com (Shu-Wie F Chen) writes:
>In article <1084.26d2a42b at desire.wright.edu>, anagram at desire.wright.edu
>((For Mongo)) writes:
---deleted discussion of hard links, symbolic links
>
>On a side note, you might want to alias ll, lf, lg, and lx to 'ls -xxx'
>instead of keeping separate binaries.  For instance, I have ll aliased
		    ^^^^^^^^^^^^^^^^^
Using links of any sort, as you noted, will not create a copy, so no
separate binaries.

>to  ls -lasF.
>

As for using aliases for this function, only csh and ksh (if you have it)
would be able to do this.  By using links pointing to the one file and
letting the program determine the function based on the name used to
call it, sh users can also have this ability.  The particular system
in the original post has this ability.

My system, ls only recognizes the lc alternate name, so I must use
either aliases or a shell script to get the function.

For sh users, the following has worked for me:


	:
	# emulate XENIX style listing commands
	# I used the following in case this happened to get run by
	# csh or ksh, which "remember" the command by its full
	# path name

	BASENAME=`basename $0`
	
	case $BASENAME in
	   l)			# long listing
	      ls -l $*
	   ;;
	   ll)			# long listing, BSD(?) style
	      ls -l $*
	   ;;
	   lf)			# columns with * and slash
	      ls -CF $*
	   ;;
	   lx)			# columns sorted in rows
	      ls -x $*
	   ;;
	   lr)			# columns, recursively
	      ls -CR $*
	   ;;
	   la)			# columns, all files
	      ls -Ca $*
	   ;;
	esac
Bob McGowan  (standard disclaimer, these are my own ...)
Product Support, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob at wyse.com



More information about the Comp.unix.wizards mailing list