watch -n 1 "paste <(ssh ai02 'nvidia-smi pmon -s um -c 1') <(ssh ai03 'nvidia-smi pmon -s um -c 1' )"
The above command is used to horizontally stack two server GPU stats together. It works without the watch command but get the following error
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `paste <(ssh ai02 'nvidia-smi pmon -s um -c 1') <(ssh ai03 'nvidia-smi pmon -s um -c 1' )'
You didn't provide a reproducible example, but I think I managed to make one for testing:
output a similar error:
To solve this problem in a simpler way, we can change
sh -c
forbash -c
:From the
watch
manual:If you need maintain the apostrophes from the original commandline, you can escape then too: