[KLUG Members] Testing for files with symbolic links
Patrick Mc Govern
members@kalamazoolinux.org
Thu, 15 Nov 2001 23:10:22 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0011_01C16E2A.B38E1700
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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 link 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?=20
Pat=20
------=_NextPart_000_0011_01C16E2A.B38E1700
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I want to test for files with =
symbolic links=20
in a shell script. I tried find, stat, symlinks with no =
luck. I=20
tried the following link test:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[ -L $HOME/linked_dir/linked_file =
] but it=20
returns "1" when I know this directory/file is symbolically linked to =
another=20
directory. The above test should work. Is there =
must be a=20
simple way to test links? </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Pat </FONT></DIV></BODY></HTML>
------=_NextPart_000_0011_01C16E2A.B38E1700--