I'm trying to store an awk command (command, not the result) in a variable. My objective is to use that variable later in the script, with different inputs. For example:
cmd=$(awk '/something/ {if ...} {...} END {...}')
$cmd $input
I've tried to store the command with $() (like in the example), also with backticks ... But I'm not able to achieve it.
I appreciate the help or any suggestion :)