How do you watch a command like?
awk 'NR%2==0 {printf "%s %8.0f", $1, $5}' filename.txt
Preceding this with "watch" gives this error:
awk: cmd. line:1: fatal: cannot open file `{printf' for reading (No such file or directory)
The answer to: Using the watch command with an argument that contains quotes was to escape the $ signs by replacing them with \$. But that gives me the error:
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0:
I wanted to ask this in the comment to that question but didn't have enough points to make comments.
Similar questions where the answers that worked for them did not work in this case:
1) https://askubuntu.com/questions/500217/how-to-properly-quote-piped-command-for-watch (answer was again to escape $ sign).
2), 3), and 4) are listed in the comments since I cannot post more than 2 links without 10 points reputation.