On Wed, Jun 26, 2002 at 09:10:19AM -0400, Alan Brown wrote:
...
> ln -sf usually works better than cp for config files.
> 
> There's no real need to use cp for most purposes and most users of this
> command got their grounding in a DOS environment.
> 
> ln and ln -s are your friends. :-)

I have a minor aversion to the use of the '-f' flag blindly.  You
should know what you are doing.  I usually 'rm' [or, yes, 'rm -f' after
an 'ls -l' to make sure I know what I'm doing] the existing symlink
before, as I said, creating a new one ['ln -s'].

Your mileage may vary.  ;-)

I have recently had to remind folks that a symbolic link may be
absolute or relative, and if it is relative, it is RELATIVE TO the
place where the new link is located.  Just passing this along.  In
other words:

        cd /opt/newstuff
        ln -s new.stuff.config /opt/etc/new.stuff.cf

does NOT do what you might think.  You would need to do:

        ln -s ../newstuff/new.stuff.config /opt/etc/new.stuff.cf

[which works wherever your current directory happens to be], or:

        ln -s /opt/newstuff/new.stuff.config /opt/etc/new.stuff.cf

[but I do still prefer relative links].

The major problem with symlinks is if they are into a directory where
things might get changes.  E.g., instead of:

        ln -s /usr/src/etc/stuff.configuration /etc/stuff.cf

I usually make my changes in the /usr/src/etc directory [where the file
is not seen while I'm editing it, and any fixes can be made privately
before going public] and have my Makefile do a copy to the new
directory.  Or, because I started doing this before 'cp -p' existed, I
do a back-to-back 'tar' to preserve all attributes.  I always 'rm -f'
first, I never do a 'cp -f'.

-- 
Joe Yao                         [EMAIL PROTECTED] - Joseph S. D. Yao
OSIS Center Systems Support                                     EMT-B
-----------------------------------------------------------------------
   This message is not an official statement of OSIS Center policies.

Reply via email to