[texhax] problem with info command

Tom Schneider toms at ncifcrf.gov
Thu Aug 26 18:29:13 CEST 2004

> >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).


% mv a b

means move a TO b


% ln -s a b


% 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"'

  case 1:
    echo 'Two arguments needed\!'

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

    echo 'Too many arguments\!'

(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.)


  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)

More information about the texhax mailing list