UTIL

Synopsis

HELP:   Executes simply functions
TYPE:   OBJECT
SYNTAX: > flcl UTIL(NET.{},RUN.{},OUT='str'/STDOUT/STDERR/DUMMY,DIR(),LOG())

Description

The UTIL command executes a function on a wildcard-based list of files. This command allows to run simple system functions like deleting or listing files that match a provided pattern which may contain wildcards. This is mainly useful on mainframe systems, for example, to find all libraries containing a certain member or to delete any kind of file under a certain qualifier.

The UTIL command prints only minimal log output. For a more verbose output (e.g. notices), please use the log object (see examples below).

To get syntax information, please use:

   flcl SYNTAX UTIL

To get help for a parameter, please use:

   flcl HELP UTIL.parameter[.parameter[...]]

To read the manual page for a parameter, please use:

   flcl MANPAGE UTIL.parameter[.parameter[...]]
      or
   flcl HELP UTIL.parameter[.parameter[...]] MAN

To generate the user manual for a command, please use:

   flcl GENDOCU UTIL=filename

Parameters can be defined by the command line (directly or per file) or by properties read from the corresponding property file.

Examples

   flcl UTIL run.list='**(CSFMOD01)'   # list all libs containing this member
   flcl UTIL run.remove='~.TEST.**'    # deletes all test files under SYSUID
   flcl UTIL run.remove='*.txt' log(message(default)) # activate default logging
   flcl UTIL run.files(input='/data/*.xml' output='[path]/out/[base].fix')
   flcl UTIL run.files(input['/a/*.xml','/b/*.dat'] exclude='*.tmp' output='[path]/out/[base].[ext]' format=TAB)
run.files - List files with output name mapping

Selects files matching one or more INPUT patterns (wildcards allowed), optionally excluding files that match any EXCLUDE pattern, and prints filenames to the output stream. The output is controlled by FORMAT.

When OUTPUT is not specified the output filename equals the input filename (identity mapping). FORMAT defaults to OUT (output name only).

Parameters:

input=<pattern> File pattern (wildcards). Repeatable (array). At least one value is required.

exclude=<pattern> Exclude pattern (wildcards). Repeatable [none].

output=<pattern> Output filename pattern using pat2str tokens: [path], [name], [ext], [copy], [upper], [lower], [search=replace], [indN], etc. [none]

format=<keyword> Output format ['OUT']: OUT -- output filename only (one per line) TAB -- input<TAB>output (one pair per line) IN -- input filename only (one per line)

Examples:

----------------------------------------------------------------------- flcl UTIL run.files(input='/data/*.xml' output='[path]/out/[base].fix') flcl UTIL run.files(input['/a/.xml','/b/.dat'] exclude='*.tmp' output='[path]/out/[base].[ext]' format=TAB) flcl UTIL run.files(input='*.txt') out=filelist.txt -----------------------------------------------------------------------