NAME

getkey - extracts values from keyword=value string

SYNOPSIS

getkey [quiet] [timestamp] [default=] [tabs] [keys] [multiple] keyword ...

DESCRIPTION

getkey reads stdin for a pair keyword=value and prints out value to stdout and exits with error code 0. If keyword is not found it prints the message to stderr:
getkey:  'keyword' not found in 'string'
and exit with error code 1.
OPTIONS
quiet -the program does not print an error message if the keyword is not found, but still exits with a code of 1.

default= prints out the specified default value if the keyword is not found exiting with a status of 1. When specified, the quiet mode is also set.

keys - prints out the key= part too rather than just the value.

multiple - picks the last keyword/value of multiple ones.

timestamp - looks for an ISO string (e.g. 2020-03-30T19:24:24Z) and prints it out.

tabs - prints out tabs instead of spaces between keyword fields.

EXAMPLE

echo done focus mm=25.4 | getkey mm 
produces the output
25.4

Program index