How to test for soft links ??

Ronald S. Woan ron at woan
Tue Dec 4 10:25:04 AEST 1990


In article <898 at ki.UUCP>, dwatts at ki.UUCP (Dan Watts) writes:
Dan> On the IBM RS/6000, is there a way to test to see if a file is a
Dan> soft link?  Under BSD, the "-h" option to test does this.  For
Dan> sysV, the option is "-l".  I'm running AIX 3.1 and the man page
Dan> for test doesn't show anything.  Is it possible that they left
Dan> this ability out??  I've got a few shell scripts that need to
Dan> know whether the file is a _real_ file or just a soft link.  I
Dan> guess I could write a little C program to figure out the file
Dan> type and return 0 or 1, but I'd rather just use test if at all
Dan> possible.

Interesting, I looked in the BSD 4.3 (URM) manual under TEST(1) and it
makes no mention of the -h manual; are you sure that it's not part of
your shell somehow? If it is not documented in the manual, chances are
the AIX programmers didn't know about it... In any case, I'll try it
out on a Sun at home...  If you are using ksh for your shell script,
"test -L filename" returns existence and symbolic link...

+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan       woan at peyote.cactus.org or woan%austin at iinus1.ibm.com +
+ other email addresses             Prodigy: XTCR74A Compuserve: 73530,2537 +



More information about the Comp.unix.aix mailing list