]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - usr.bin/pathchk/pathchk.1
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / usr.bin / pathchk / pathchk.1
1 .\" Copyright (c) 2001, 2002 Chuck Rouillard
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. The name of the author may not be used to endorse or promote
13 .\"    products derived from this software without specific prior written
14 .\"    permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
17 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd May 1, 2010
31 .Dt PATHCHK 1
32 .Os
33 .Sh NAME
34 .Nm pathchk
35 .Nd check pathnames
36 .Sh SYNOPSIS
37 .Nm
38 .Op Fl pP
39 .Ar pathname ...
40 .Sh DESCRIPTION
41 The
42 .Nm
43 utility checks whether each of the specified
44 .Ar pathname
45 arguments is valid or portable.
46 .Pp
47 A diagnostic message is written for each argument that:
48 .Bl -bullet
49 .It
50 Is longer than
51 .Dv PATH_MAX
52 bytes.
53 .It
54 Contains any component longer than
55 .Dv NAME_MAX
56 bytes.
57 (The value of
58 .Dv NAME_MAX
59 depends on the underlying file system.)
60 .It
61 Contains a directory component that is not searchable.
62 .El
63 .Pp
64 It is not considered an error if a
65 .Ar pathname
66 argument contains a nonexistent component as long as a component by that
67 name could be created.
68 .Pp
69 The options are as follows:
70 .Bl -tag -width indent
71 .It Fl p
72 Perform portability checks on the specified
73 .Ar pathname
74 arguments.
75 Diagnostic messages will be written for each argument that:
76 .Bl -bullet
77 .It
78 Is longer than
79 .Dv _POSIX_PATH_MAX
80 .Pq 255
81 bytes.
82 .It
83 Contains a component longer than
84 .Dv _POSIX_NAME_MAX
85 .Pq 14
86 bytes.
87 .It
88 Contains any character not in the portable filename character set (that is,
89 alphanumeric characters,
90 .Ql \&. ,
91 .Ql \&-
92 and
93 .Ql _ ) .
94 No component may start with the hyphen
95 .Pq Ql \&-
96 character.
97 .El
98 .It Fl P
99 In addition to the default or
100 .Fl p
101 checks, write a diagnostic for each argument that:
102 .Bl -bullet
103 .It
104 Is empty.
105 .It
106 Contains a component that starts with a hyphen.
107 .El
108 .El
109 .Sh EXIT STATUS
110 .Ex -std
111 .Sh EXAMPLES
112 Check whether the names of files in the current directory are portable to
113 other
114 .Tn POSIX
115 systems:
116 .Pp
117 .Dl "find . -exec pathchk -p -- {} +"
118 .Sh SEE ALSO
119 .Xr getconf 1 ,
120 .Xr pathconf 2 ,
121 .Xr stat 2
122 .Sh STANDARDS
123 The
124 .Nm
125 utility conforms to
126 .St -p1003.1-2001 .
127 .Sh HISTORY
128 A
129 .Nm
130 utility appeared in
131 .Fx 5.0 .