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