[texhax] problem with info command

Randolph J. Herber herber at dcdrjh.fnal.gov
Thu Aug 26 19:28:26 CEST 2004


<sarcasm>
   Obviously, I do not know what I am talking about, I only have been
   supporting UNIX and UNIX-like operating systems for about a quarter
   century, including a decade at AT&T Bell Laboratories at Indian Hill
   in Naperville, IL.
</sarcasm>

$ ls a b
Cannot access a: No such file or directory
Cannot access b: No such file or directory
$ touch a
$ ls a b
Cannot access b: No such file or directory
a
$ ln -s a b
$ ls -l a b
-rw-r--r--    1 herber   g163           0 Aug 26 12:14 a
lrwxrwxrwx    1 herber   g163           1 Aug 26 12:14 b -> a
$

The order is source then target.  The new ``thing'' is on the right.
It is the same order for all of mv, cp and ln.

ln -s source target	Create a symbolic link to source at target.
cp source target	Make a copy of source at target.
mv source target	Move source to target.

If target is a directory, then it becomes ``in(to) target.''

I admit that when either are device files, sockets or named pipes,
then the rules get a tiny bit strange.  But, that only affects the
semantics of the operation and not the operand order.

The following header lines retained to effect attribution:
>Date: Thu, 26 Aug 2004 12:29:13 -0400 (EDT)
>From: Tom Schneider <toms at ncifcrf.gov>
>Subject: Re: [texhax] problem with info command
>To: herber at fnal.gov
>Cc: texhax at tug.org (texhax)
>X-Spam-Level:

>> >ln -s /usr/share/info /usr/bin/info

>> >root will have to do this.  Oh, and i sometimes get the order backwards.
>> >i think this is right, but if it says it already exists, then switch em
>> >around (that's how I know, anyway).

>> >I hope this solves your problem

>> >bobby

>> 	[SNIP]

>> 	The order is simple to remember: think of it as a move (mv)
>> 	or a copy (cp).  In many UNIX-like operating systems, mv, cp
>> 	and ln are the same executable with several links (names).

>Actually,

>% mv a b

>means move a TO b

>while

>% ln -s a b

>gives:

>% ls -l b
>lrwx------  1 root  wheel  1 26 Aug 12:22 b@ -> a

>that is, it makes a link TO a FROM b.  That's why it is hard
>to remember, it's backwards from what one expects.

>For this reason I use a script, lk:

>#!/bin/csh -f
>#(ie run the cshell on this but don't read the .cshrc)

># lk: link NAME to FILE

>switch ($#argv)
>  case 0:
>    echo version = 1.06 of lk 2001 Nov 5
>    # 2001 Nov  5, 1.06 object if file exists
>    # 2000 Nov 30, 1.05 allow for spaces in manes (passed in quotes)
>    # 2000 Oct 19, 1.04 protect if file is there
>    # 1989 November 6, 1.00 origin
>    echo Thomas Schneider, toms at ncifcrf.gov
>    echo ' '
>    echo Link the first argument to the name given
>    echo in the second argument:
>    echo ' '
>    echo 'lk NAME (to) FILE'
>    echo ' '
>    echo 'You can even make links if the file has spaces by surrounding'
>    echo 'the names with quotes:'
>    echo ' '
>    echo 'lk "Multipart NAME" "multipart FILE"'
>  breaksw

>  case 1:
>    echo 'Two arguments needed\!'
>  breaksw

>  case 2:
>    if !(-f "$1") then
>      ln -s "$2" "$1"
>    else
>      echo 'lk: refuse to link: '$1' exists\!'
>      exit
>    endif
>    if (! -f "$2" && ! -d "$2") then
>       echo "WARNING: file or directory "$2" DOES NOT EXIST (yet?)"
>    endif
>  breaksw

>  default:
>    echo 'Too many arguments\!'
>  breaksw
>endsw

>(Sorry for being off topic folks, but you might find the above script
>useful.  See http://www.lecb.ncifcrf.gov/~toms/toolkit.html for other
>useful tricks, especially atchange.)

>Tom

>  Dr. Thomas D. Schneider
>  National Cancer Institute
>  Laboratory of Experimental and Computational Biology
>  Frederick, Maryland  21702-1201
>  toms at ncifcrf.gov
>  permanent email: toms at alum.mit.edu (use only if first address fails)
>  http://www.lecb.ncifcrf.gov/~toms/

Randolph J. Herber, herber at fnal.gov, +1 630 840 2966, CD/CDFTF PK-149F,
Mail Stop 318, Fermilab, Kirk & Pine Rds., PO Box 500, Batavia, IL 60510-0500,
USA.  (Speaking for myself and not for US, US DOE, FNAL nor URA.)  (Product,
trade, or service marks herein belong to their respective owners.)



More information about the texhax mailing list