[KLUG Members] Testing for files with symbolic links

Patrick McGovern members@kalamazoolinux.org
Fri, 16 Nov 2001 09:10:57 -0500


> >I want to test for files with symbolic links in a shell script. 
> >I tried find, stat, symlinks with no luck.  I tried the following
> l>ink test:
> >[ -L $HOME/linked_dir/linked_file ]  but it returns "1" when I know 
> >this directory/file is symbolically linked to another directory. 
> >The above test should work.  Is there must be a simple way to test links?


>The "-L" should work.  Is the file linked, or it's parent directory?  (both?)

>Can you be more specific and display the actual script code and a "ls -l" 
>of all directories and files involved?

Sorry, I don't have access to my machine now to provide examples.  It just occured to me that since these files are read only, I will test for that file condition.  This will be a much better solution!!  Thanks anyway!!
Pat