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

Re: how to tell a dangling symlink?



On Sat, Apr 24, 1999 at 12:09:27PM -0600, Marcelo E. Magallon wrote:
> 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...

[root@goodguy(4:57pm)-~/test]%ls -l
total 0
lrwxrwxrwx   1 root     root            7 Apr 24 16:57 broken -> no_file
-rw-r--r--   1 root     root            0 Apr 24 16:57 real_file
lrwxrwxrwx   1 root     root            9 Apr 24 16:57 working -> real_file

[root@goodguy(4:57pm)-~/test]%test -f broken || echo broken link
broken link

[root@goodguy(4:58pm)-~/test]%test -f working || echo broken link
[root@goodguy(4:58pm)-~/test]%

--
-----    -- - -------- --------- ----  -------  -----  - - ---   --------
Ben Collins <bcollins@debian.org>                        Debian GNU/Linux
OpenLDAP Dev - bcollins@openldap.org     The Choice of the GNU Generation
------ -- ----- - - -------   ------- -- ---- - -------- - --- ---- -  --


Reply to: