Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2006 12:12:20 -0400 (EDT)
From:      sara lidgey <slidgey@yahoo.ca>
To:        Brian O'Shea <b_oshea@yahoo.com>, freebsd-questions@freebsd.org
Subject:   Re: multiple links with single ln command
Message-ID:  <20060628161220.93908.qmail@web35705.mail.mud.yahoo.com>
In-Reply-To: <20060627231910.52369.qmail@web39505.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for all the ideas.  They are very helpful.
-S

Brian O'Shea <b_oshea@yahoo.com> wrote: It can be done with a shell for-loop:

$ mkdir a b c
$ for dir in a b ; do (cd $dir ; ln -s ../c clink) ; done

But this is technically not a single command, and it assumes that
you are using the Bourne Shell (/bin/sh) or a Bourne-compatible shell
(ksh, zsh, bash, etc.).  If you are a csh or tcsh user, may God help
you. (I mean look up the syntax in the appropriate man page.)

-brian

--- sara lidgey  wrote:
> 
> Hi All,
> 
> I've read the man page for ln but can't find a way to do this.  I want to
> create multiple links to a single directory with one command.  Consider the
> following example.  I have a directory structure like this:
> test/a/
> test/b/
> test/c/
>  I want to create a symbolic link called "clink" in test/a/ and test/b/ which
> points to test/c/
> 
> The only way I know to do this is with two commands:
> ln -s test/c test/a/clink
> ln -s test/c test/b/clink
> 
> Can it be done with a single command?
> 
> thanks.  sorry if this is a no-brainer,
> S



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


 				
---------------------------------
Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada Messenger with Voice



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060628161220.93908.qmail>