[comp.unix.questions] link

jgd@csd4.csd.uwm.edu (John G Dobnick) (08/12/90)

Stupid question time (I haven't asked one of these for a while, so
I'm due.  :-) ]


Re: 4.3 "ln".  The manpage says ln(1) can be called with only one name.
	       What purpose does this serve?   Given that ln(1) is
	       supposed to create "links", I would think you need a
	       minimum of *two* filenames, no?  What am I missing
	       here?

Manpage extract:

LN(1)               UNIX Programmer's Manual                LN(1)

NAME
     ln - make links

SYNOPSIS
     ln [ -s ] sourcename [ targetname ]
     ln [ -s ] sourcename1 sourcename2 [ sourcename3 ... ] targetdirectory

DESCRIPTION

     Given one or two arguments, ln creates a link to an existing
     file sourcename.  If targetname is given, the link has that
     name; targetname may also be a directory in which to place
     the link; otherwise it is placed in the current directory.
     If only the directory is specified, the link will be made to
     the last component of sourcename.

The first line under DESCRIPTION can be read as "Given one argument, _ln_
creates a link to an existing file _sourcename_."   

Um, excuse me, but *what* link to _sourcename_?????  Seems to me you need
a minimum of two (2) arguments here to do anything useful.

Am I correct in assuming that this is just a case of unclear writing?
Or am I missing something obvious?  (And if so, what?)

Nitpickingly,
-- 
John G Dobnick  (JGD2)
Computing Services Division @ University of Wisconsin - Milwaukee
INTERNET: jgd@csd4.csd.uwm.edu             ATTnet: (414) 229-5727
UUCP: uunet!uwm!csd4.csd.uwm.edu!jgd

"Knowing how things work is the basis for appreciation,
and is thus a source of civilized delight."  -- William Safire

gs26@prism.gatech.EDU (Glenn R. Stone) (08/12/90)

In <5698@uwm.edu> jgd@csd4.csd.uwm.edu (John G Dobnick) writes:

>Stupid question time (I haven't asked one of these for a while, so
>I'm due.  :-) ]

It ain't a stupid question if you don't know the answer.
     -- old User Assistants' motto.
     (they don't use it any more; they've gone way downhill :( )

>Re: 4.3 "ln".  The manpage says ln(1) can be called with only one name.
>	       What purpose does this serve?   Given that ln(1) is
>	       supposed to create "links", I would think you need a
>	       minimum of *two* filenames, no?  What am I missing
>	       here?

If I do

plab:/usr/rbin> ln -s /bin/diff

I've created a symlink in the current directory to /bin/diff, with the 
name "diff".  (real useful for your rsh freshcritters to be able to check
their programs against published answers :)  In general, ln(1) with a 
single argument makes a link to the specified file with a name the same
as the last element of the given file path, the new link being in the current
working directory.

So, after the above example,

plab:usr/rbin> ls -l diff

lrwx------  1 gs26            9 Aug 12 12:14 diff -> /bin/diff

Methinks TFM could benefit from an example.  Of course, then we 
UN*X gurus couldn't benefit from job security.... :) :) :)

p.s. no, vernard, that's not YOUR plab I was playing on... :)

-- Glenn R. Stone
gs26@prism.gatech.edu

gwyn@smoke.BRL.MIL (Doug Gwyn) (08/13/90)

In article <5698@uwm.edu> jgd@csd4.csd.uwm.edu (John G Dobnick) writes:
-     ln [ -s ] sourcename [ targetname ]
-     Given one or two arguments, ln creates a link to an existing
-     file sourcename.  If targetname is given, the link has that
-     name; targetname may also be a directory in which to place
-     the link; otherwise it is placed in the current directory.
-Um, excuse me, but *what* link to _sourcename_?????  Seems to me you need
-a minimum of two (2) arguments here to do anything useful.

The description TELLS you what happens.
It is extremely easy to try this out and empirically determine what happens.

rogerk@mips.COM (Roger B.A. Klorese) (08/14/90)

In article <5698@uwm.edu> jgd@csd4.csd.uwm.edu (John G Dobnick) writes:
>Stupid question time (I haven't asked one of these for a while, so
>I'm due.  :-) ]
>
>
>Re: 4.3 "ln".  The manpage says ln(1) can be called with only one name.
>	       What purpose does this serve?   Given that ln(1) is
>	       supposed to create "links", I would think you need a
>	       minimum of *two* filenames, no?  What am I missing
>	       here?

	ln -s /some/other/dir/foo

creates a link called "foo" in the current directory.
-- 
ROGER B.A. KLORESE      MIPS Computer Systems, Inc.      phone: +1 408 720-2939
MS 4-02    950 DeGuigne Dr.   Sunnyvale, CA  94086   voicemail: +1 408 524-7421
rogerk@mips.COM         {ames,decwrl,pyramid}!mips!rogerk         "I'm the NLA"
"If the world were a logical place, men would ride sidesaddle." -Rita Mae Brown