diff options
author | 2002-05-17 15:04:32 +0000 | |
---|---|---|
committer | 2002-05-17 15:04:32 +0000 | |
commit | f4acd8af36c24a95a1ac7f5d8868460c7e16e1ec (patch) | |
tree | 8a5fa0df8b531efdaca0c410c64dcd119683d143 | |
parent | version.h (diff) | |
download | wireguard-openbsd-f4acd8af36c24a95a1ac7f5d8868460c7e16e1ec.tar.xz wireguard-openbsd-f4acd8af36c24a95a1ac7f5d8868460c7e16e1ec.zip |
The standard way to get info on symlinks is -L, not -h; Peter Werner
-rw-r--r-- | usr.bin/find/find.1 | 27 | ||||
-rw-r--r-- | usr.bin/find/main.c | 9 |
2 files changed, 21 insertions, 15 deletions
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index da1f05db65f..9f9d9265285 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: find.1,v 1.34 2001/08/22 23:43:13 deraadt Exp $ +.\" $OpenBSD: find.1,v 1.35 2002/05/17 15:04:32 millert Exp $ .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -43,7 +43,7 @@ .Nd walk a file hierarchy .Sh SYNOPSIS .Nm find -.Op Fl HdhXxW +.Op Fl dHhLXxW .Op Fl f Ar file .Ar file Op Ar ... .Op Ar expression @@ -65,15 +65,6 @@ is assumed. .Pp The options are as follows: .Bl -tag -width Ds -.It Fl H -Causes the file information and file type (see -.Xr stat 2 ) -returned for each symbolic link encountered on the command line to be -those of the file referenced by the link, not the link itself. -If the referenced file does not exist, the file information and type will -be for the link itself. -File information of all symbolic links not on -the command line is that of the link itself. .It Fl d Causes .Nm @@ -92,7 +83,21 @@ Specifies a file hierarchy for to traverse. File hierarchies may also be specified as the operands immediately following the options. +.It Fl H +Causes the file information and file type (see +.Xr stat 2 ) +returned for each symbolic link encountered on the command line to be +those of the file referenced by the link, not the link itself. +If the referenced file does not exist, the file information and type will +be for the link itself. +File information of all symbolic links not on +the command line is that of the link itself. .It Fl h +An alias for the +.Fl L +option. +This option exists for backwards compatability. +.It Fl L Causes the file information and file type (see .Xr stat 2 ) returned for each symbolic link to be those of the file referenced by the diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c index 2482072419c..94ba3ba2644 100644 --- a/usr.bin/find/main.c +++ b/usr.bin/find/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.13 2002/02/16 21:27:46 millert Exp $ */ +/* $OpenBSD: main.c,v 1.14 2002/05/17 15:04:32 millert Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -35,7 +35,7 @@ #ifndef lint /*static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: main.c,v 1.13 2002/02/16 21:27:46 millert Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.14 2002/05/17 15:04:32 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -83,7 +83,7 @@ main(argc, argv) sigaction(SIGINFO, &sa, NULL); ftsoptions = FTS_NOSTAT|FTS_PHYSICAL; - while ((ch = getopt(argc, argv, "Hdf:hXxW")) != -1) + while ((ch = getopt(argc, argv, "Hdf:hLXxW")) != -1) switch(ch) { case 'H': ftsoptions |= FTS_COMFOLLOW; @@ -95,6 +95,7 @@ main(argc, argv) *p++ = optarg; break; case 'h': + case 'L': ftsoptions &= ~FTS_PHYSICAL; ftsoptions |= FTS_LOGICAL; break; @@ -145,6 +146,6 @@ static void usage() { (void)fprintf(stderr, - "usage: find [-HdhXxW] [-f file] file [...] [expression]\n"); + "usage: find [-dHhLXxW] [-f file] file [...] [expression]\n"); exit(1); } |