coreutils
[Top][All Lists]
Advanced

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

Re: Is there a way to prompt error if 'ln -s'es target does not exist?


From: Pádraig Brady
Subject: Re: Is there a way to prompt error if 'ln -s'es target does not exist?
Date: Wed, 16 May 2012 14:39:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

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.



reply via email to

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