Blame Manuals/tcar_getFilesList.sh.asciidoc

Alain Reguera Delgado e54180
tcar_getFilesList.sh(1)
Alain Reguera Delgado e54180
=======================
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
== Name
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
tcar_getFilesList - Create customized list of files for further
Alain Reguera Delgado e54180
processing.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
== Synopsis
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
*tcar_getFilesList [--pattern|--mindepth|--maxdepth|--type|--uid] LOCATION*
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
== Description
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
The *tcar_getFilesList* standardizes the way list of files are built
Alain Reguera Delgado e54180
inside the *centos-art.sh* script.  This function outputs a sorted and
Alain Reguera Delgado e54180
unique list of files based on the options and location provided as
Alain Reguera Delgado e54180
argument. This function is an interface to the *find* command. Don't
Alain Reguera Delgado e54180
use *find* command directly inside the centos-art.sh script. Instead,
Alain Reguera Delgado e54180
use the *tcar_getFilesList* function.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
The +LOCATION+ arguments must be the absolute path to a directory and
Alain Reguera Delgado e54180
specifies where the search of files in any form (e.g., directories,
Alain Reguera Delgado e54180
links, etc.) will take place in. If +LOCATION+ isn't a directory, the
Alain Reguera Delgado e54180
script finishes its execution with an error message.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
The *tcar_getFilesList* accepts the following options:
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
--pattern="REGEX"::
Alain Reguera Delgado e54180
    This option specifies a posix-egrep type regular expression as
Alain Reguera Delgado e54180
    value. This regular expression is applied to path specified in
Alain Reguera Delgado e54180
    +LOCATION+ argument. Only file paths that match this regular
Alain Reguera Delgado e54180
    expression inside +LOCATION+ directory will be included in the
Alain Reguera Delgado e54180
    final list of files. By default, if this option is not provided,
Alain Reguera Delgado e54180
    the ``+^/.*[[:alnum:]_/-]+$+'' regular expression
Alain Reguera Delgado e54180
    is used.
Alain Reguera Delgado e54180
+
Alain Reguera Delgado e54180
When you use the *tcar_getFilesList* you don't need to specified the
Alain Reguera Delgado e54180
absolute path of files you want to look for.  This is something
Alain Reguera Delgado e54180
*tcar_getFilesList* already does for you.  When you use this function,
Alain Reguera Delgado e54180
the value you pass as regular expression isn't the final regular
Alain Reguera Delgado e54180
expression used. Instead, the regular expression you pass is used to
Alain Reguera Delgado e54180
build the final regular expression passed to *find* command.  The
Alain Reguera Delgado e54180
final regular expression passed to find is ``+^/.*${PATTERN}$+'',
Alain Reguera Delgado e54180
where +${PATTERN}+ is the value you passed to *--pattern* option as
Alain Reguera Delgado e54180
REGEX.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
--mindepth="NUMBER"::
Alain Reguera Delgado e54180
    This option specifies the minimal +NUMBER+ of levels deep the
Alain Reguera Delgado e54180
    search should go under the directory +LOCATION+ specified. For
Alain Reguera Delgado e54180
    example, if you specify *--mindepth="2"* the search will start two
Alain Reguera Delgado e54180
    levels deep considering the path provided as section. 
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
--maxdepth="NUMBER"::
Alain Reguera Delgado e54180
    This option specifies the maximum +NUMBER+ of levels deep the
Alain Reguera Delgado e54180
    search should go under the directory +LOCATION+ specified. For
Alain Reguera Delgado e54180
    example, if you specify *--maxdepth="2"* the search will begin in
Alain Reguera Delgado e54180
    the very same directory path you provided as +LOCATION+ and stop
Alain Reguera Delgado e54180
    two levels deep using it as section.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
--type="STRING"::
Alain Reguera Delgado e54180
    This option specifies the type of files being searched. This
Alain Reguera Delgado e54180
    option accepts the same values the *find* *-type* option does.
Alain Reguera Delgado e54180
    However, the following +STRING+ values are the most used inside
Alain Reguera Delgado e54180
    the script so far:
Alain Reguera Delgado e54180
+
Alain Reguera Delgado e54180
- d — directory.
Alain Reguera Delgado e54180
- f — regular file.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
--uid="NUMBER"::
Alain Reguera Delgado e54180
    This option specifies the numeric user id of the files you want to
Alain Reguera Delgado e54180
    search. Only files that match this numeric user id will be added
Alain Reguera Delgado e54180
    to the final list of files.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
Use the *tcar_getFilesList* whenever you need to build list of files
Alain Reguera Delgado e54180
for further processing.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
== Bugs
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
See https://centos.org.cu/bugs/
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
== Authors
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
The *tcar_checkFiles* function has received contributions from the
Alain Reguera Delgado e54180
following people:
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
- Alain Reguera Delgado <al@centos.org.cu>, =COPYRIGHT_YEAR_LIST=
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
== License
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
Copyright (C) =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER=
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado e54180
it under the terms of the GNU General Public License as published by
Alain Reguera Delgado e54180
the Free Software Foundation; either version 2 of the License, or (at
Alain Reguera Delgado e54180
your option) any later version.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado e54180
WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado e54180
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado e54180
General Public License for more details.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
You should have received a copy of the GNU General Public License
Alain Reguera Delgado e54180
along with this program; if not, write to the Free Software
Alain Reguera Delgado e54180
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado e54180
Alain Reguera Delgado e54180
// vim: set syntax=asciidoc: