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

find(1) man page



Just a small, one sentence addition/clarification on pattern matching
for the ``-name pattern'' entry of the find(1) man page.


OLD:
-name pattern
    True if the last component of the pathname being examined matches
    pattern.  Special shell pattern matching characters (`[', `]',
    `*', and `?') may be used as part of pattern.  These characters
    may be matched explicitly by escaping them with a backslash
    (`\').

NEW:
-name pattern
    True if the last component of the pathname being examined matches
    pattern.  Special shell pattern matching characters (`[', `]',
    `*', and `?') may be used as part of pattern.  These characters
    may be matched explicitly by escaping them with a backslash
    (`\').  If your shell is already using the backslash (`\') as an
    escape character, you will need to use the backslash twice (`\\')
    to explicitly match the special characters.


TEST:
    # echo $SHELL
    /bin/ksh
    # mkdir -p /tmp/test
    # cd /tmp/test
    # touch \*test
    # touch \?test
    # touch \[test
    # touch \]test
    # ls -l
    total 0
    -rw-r--r--  1 root  wheel  0 Dec 26 00:36 *test
    -rw-r--r--  1 root  wheel  0 Dec 26 00:36 ?test
    -rw-r--r--  1 root  wheel  0 Dec 26 00:36 [test
    -rw-r--r--  1 root  wheel  0 Dec 26 00:36 ]test
    # find . -name \*test -print
    ./*test
    ./?test
    ./[test
    ./]test
    # find . -name \\*test -print
    ./*test
    #


PATCH:

--- src/usr.bin/find/find.1.old	Mon Dec 26 00:25:13 2005
+++ src/usr.bin/find/find.1	Mon Dec 26 00:58:17 2005
@@ -283,6 +283,11 @@
 These characters may be matched explicitly by escaping them with a
 backslash
 .Pq Ql \e .
+If your shell is already using the backslash
+.Pq Ql \e 
+as an escape character, you will need to use the backslash twice 
+.Pq Ql \e\e 
+to explicitly match the special characters.
 .It Ic -newer Ar file
 True if the current file has a more recent last modification time than
 .Ar file .



Visit your host, monkey.org