[prev in list] [next in list] [prev in thread] [next in thread] 

List:       coreutils
Subject:    Re: Is there a way to prompt error if 'ln -s'es target does not exist?
From:       Pádraig_Brady <P () draigBrady ! com>
Date:       2012-05-16 13:39:42
Message-ID: 4FB3AE1E.9060402 () draigBrady ! com
[Download RAW message or body]

On 05/16/2012 03:01 AM, Peng Yu wrote:
> Hi,
> 
> I don't see an option of 'ln -s' that prompts some error if the target
> does not exist. In case that I miss anything, could anybody who are
> more familar with ln confirm with me? Thanks!

ln will create a dangling like without error.
If that's not what you want you can:

[ -e "$target" ] && ln -s "$target" linkname

cheers,
Pádraig.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic