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

Re: how to tell a dangling symlink?



"Marcelo E. Magallon" <mmagallo@efis.ucr.ac.cr> writes:

> Hi,
> 
>  is:
> 
>         file -b dangling_symlink | grep -q '^broken symbolic link to'
> 
>  a good way to test for a dangling_symlink?  I'm worried about
>  locales...

Yes, it will fail in non-english locales.  Hmm..  Isn't it sufficient
to test the exit value of `file'?

if file -b dangling_symlink>/dev/null then
  blahblah...
fi

-- 
Changwoo Ryu


Reply to: