Skip to content

Instantly share code, notes, and snippets.

@wwalker
Created December 7, 2019 20:54
Show Gist options
  • Save wwalker/e4402c07e1f62d8437935133188c6a98 to your computer and use it in GitHub Desktop.
Save wwalker/e4402c07e1f62d8437935133188c6a98 to your computer and use it in GitHub Desktop.
In a script I build up a lit of filters that I want to apply to the output of a program.
This list may vary (tee, sort, uniq, ts, etc.) Could be all of them or none of them or any combination.
So I built up a list in a variable (_ql_append)
So _ql_append will have something like this in it:
"ilts -S -E | tee":
then the script executes this line:
( echo "$@"; "$@" ) | $_ql_append > "$_ql_filepath" 2>&1
But, the pipe synbols in _ql_append are treated as words, not as pipes:
+ cat '|' ilts -S -E '|' tee
so, if I want to build up an arbitrary piped set of filters, how should I
do it? (the filters are all static strings in the program, not a security/rpbustness issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment