fmatch

Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 28 February 2013
Index Return to Main Contents

 

NAME

fmatch - return values for a given key from a data file

 

SYNOPSIS

edrc/lib/fmatch [ -h ]

fmatch -k key_regex [ -f data_file ]

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

prints the values of the given key_regex from the file csv database specified on command line using the -f option or in the $FMATCH_DATA_FILE environment variable.

The structure of the data_file is:

key;values_list;

where empty lines and lines starting with a # are considered as comments. The backslash can be used to define rows spanning multiple lines in the data_file.

The values_list is a white space separated list of values for a certain key and are returned as a uniquely sorted list to stdout.

 

OPTIONS

-h
usage message.

-k key_regex
key as regular expression as known from the egrep(1) command for selecting the related values in the data_file.

-f data_file
file to select the values from. If the environment variable $FMATCH_DATA_FILE is set this option is optional. The data_file must have the following format:

key;values;

Empty lines and lines starting with a # are considered as comments. The backslash can be used to define rows spanning multiple lines in the data_file.

Example data_file :

#
# etc/hostlist.dat - hostlist csv database file
#
# [00] 12.08.2008 CWa   Initial Version
#

#
# Format:
#
#   key ::= <Customer>--<SERVER_ENVIRONMENT>
#
#   <key>;<value_list>;
#

ACME--INFRASTRUCTURE;   acme001 acme002;

LooneyTunes--TEST;      ltunes001 ltunes005 ltunes008; 
LooneyTunes--PRODUCTION;ltunes002 ltunes003 ltunes004 \
                        ltunes006 ltunes007;

BOULDER--DEVELOPMENT;   boulder000 boulder001 boulder002; 
BOULDER--TEST;          boulder100 boulder101 boulder102; 
BOULDER--PRODUCTION;    boulder201 boulder201 boulder202 \
                        boulder203;


 

ENVIRONMENT

$FMATCH_DATA_FILE
data_file as specified in the -f option. When this environment variable is set, the -f option is optional.

 

EXIT STATUS

0
no error.

4
usage message listed.

 

FILES

-

 

EXAMPLES

-

 

SEE ALSO

edrcintro(1), egrep(4), regexintro(4), ypmatch(1)

 

NOTES

-

 

BUGS

-

 

AUTHOR

fmatch was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2013 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:53:02 GMT, August 28, 2024