Introducing UNIX and Linux |
Advanced shell programmingOverview |
test . Followed by the
name of a path, pathchk will check that it does not
breach any of those limits, by (for example) being simply too long.
It will also check that no component of the pathname cannot be
searched because it does not have execute permission. With
option -p ('portable') it will also indicate any
potential problems where the name may be acceptable for the current
system, but breaches certain minimum limits defined by POSIX, and
might thus present problems if the name were to be used on a
different system.
Worked exampleIs it sensible to write a script to create and use a file called
This message indicates that any filename of length above 14 may not be allowed on every system, so the answer is 'no'. If, during the course of a session logged on to a UNIX system,
you have reset a number of variables, it may be that you
accidentally change the value of a system variable that was defined
when you logged in. You can find what the values of the
system-defined variables are with command getconf ('get
configuration'). This can also be useful in a shell script if you
wish to check that such variables have the required values. Perhaps
the clearest example of where this would be useful would be in the
case of
the default value would be printed out and you could reset
There are a number of variables which are not 'environment'
variables (and cannot be changed) but indicate the system limits
(such as the maximum length of a filename allowed, and the maximum
number of processes you can have running at any one time). These
values can only be accessed using |
Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck