bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to overwrite a symbolic link?


From: Bob Proulx
Subject: Re: How to overwrite a symbolic link?
Date: Thu, 6 May 2010 16:26:32 -0600
User-agent: Mutt/1.5.18 (2008-05-17)

Pierre Gaston wrote:
> Peng Yu wrote:
> > Suppose that I have a symbolic link link1 pointing to file1. When I
> > write to link1, I don't want file1 change. I want it to remove the
> > link generated a new file and write to it.
> >
> > pipe '>' will change file 1. I'm wondering if there is way to do so,
> > so that I don't have to test whether it is a symbolic link or not
> > explicitly.
>
> rm link1

  rm -f link1

The -f will prevent a stat(2) of the target before removal and will
prevent a warning if the target has already been removed or otherwise
does not exist.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]