fnlen - displays info on filename lengths
fnlen [options] <file1> ... <fileN>
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.
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
- -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
This option forces names listed to be interpreted as directory names.
The files immediately within the listed directories will be listed.
Display a short help message.
Display a manpage for fnlen.
Display verbose error messages.
Display the version information for fnlen.
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
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.
Wayne Morrison, email@example.com
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.