SHTK_LIST_FILTER(3)
SHTK_LIST_FILTER(3) Library Functions Manual SHTK_LIST_FILTER(3)

shtk_list_filterFilters the elements of a list based on a pattern

shtk_import list

shtk_list_filter pattern [list_value1 .. list_valueN]

The shtk_list_filter function selects and returns the elements of the list provided by the arguments list_value1 to list_valueN if the match the given shell pattern. Each list value must be provided as a separate positional parameter.

original="foo foobar baz frobz"
filtered="$(shtk_list_filter 'foo*' ${original})"
echo "Results: ${filtered}"

shtk(3), shtk_list(3)

shtk_list_filter first appeared in shtk 1.0.

November 7, 2014 Debian