NAME
fnlen - displays info on filename lengths
SYNOPSIS
fnlen [options] <file1> ... <fileN>
DESCRIPTION
fnlen displays the lengths of the filenames listed on the command line.
If no filenames are listed, then the files in the current directory will
be given. If the -d option is given, then the command-line arguments
will be assumed to be the names of directories, and name lengths for the
files in those directories will be given.
This was written with the assumption that the arguments will be file
names. However, those arguments can be any strings for which the user
wants string lengths.
OPTIONS
fnlen takes the following options:
- -g minlen
This option specifies the lower bound of the filename length. All names
listed must be greater than this length. If the -g and -l options
are both specified, then the -g length must be less than the -l
length.
- -l maxlen
This option specifies the upper bound of the filename length. All names
listed must be less than this length. If the -g and -l options
are both specified, then the -l length must be greater than the -l
length.
- -d
This option forces names listed to be interpreted as directory names.
The files immediately within the listed directories will be listed.
- -h
Display a short help message.
- -m
Display a manpage for fnlen.
- -v
Display verbose error messages.
- -V
Display the version information for fnlen.
LICENSE
Copyright 2016 Wayne Morrison
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
AUTHOR
Wayne Morrison, wayne@waynemorrison.com
NOTES
This script was originally written in Perl for a purpose that has been
lost in the depths of time. While working to learn bash, I decided it
might be useful to convert the Perl version to bash. It might not be
very useful for actual use, but it helped in learning bash programming.
There are undoubtedly better ways this could be written, but this was
primarily a learning exercise.