[14682] in Athena Bugs
Re: sun4 8.0I: ln
daemon@ATHENA.MIT.EDU (John Hawkinson)
Thu Sep 19 20:24:14 1996
Date: Thu, 19 Sep 1996 20:24:10 -0400
To: chashmlt@MIT.EDU
Cc: bugs@MIT.EDU
In-Reply-To: "[14681] in Athena Bugs"
From: John Hawkinson <jhawk@MIT.EDU>
> man ln indicates that the argument order is: ln -s filename1
> target, but in fact it functions as ln -s target filname1
> given the definitions of target and filename1 in teh man
> page.
I don't think this is so. The manpage states:
ln [ -f ] [ -n ] [ -s ] filename1 [ filename2...filenamen ] target
...
OPTIONS
...
-s ln will create a symbolic link. A symbolic link
contains the name of the file to which it is
linked. Symbolic links may span file systems and
may refer to directories.
If the -s option is used with two arguments, tar-
get may be an existing directory or a non-existent
file. If target already exists and is not a
directory, an error is returned. filenamen may be
any path name and need not exist. If it exists,
it may be a file or directory and may reside on a
different file system from target. If target is
an existing directory, a file is created in direc-
tory target whose name is filenamen or the last
component of filenamen. This file is a symbolic
> link that references filenamen. If target does
> not exist, a file with name target is created and
> it is a symbolic link that references filenamen.
The trivial case is the highlighted one, where a file with the name target
is created.
Example:
Sakhmet!jhawk] /tmp/c> touch filename
[Sakhmet!jhawk] /tmp/c> ls -l
total 0
-rw-r--r-- 1 jhawk 101 0 Sep 19 20:23 filename
[Sakhmet!jhawk] /tmp/c> ln -s filename target
[Sakhmet!jhawk] /tmp/c> ls -l
total 2
-rw-r--r-- 1 jhawk 101 0 Sep 19 20:23 filename
lrwxrwxrwx 1 jhawk 101 8 Sep 19 20:23 target -> filename
--jhawk