we want to capture the time from the output and not the time from the command sshpass
expected output
Sun Jul 14 12:47:49 UTC 2019 Sun Jul 14 12:47:49 UTC 2019 Sun Jul 14 12:47:49 UTC 2019 but from the command we get:
sshpass -p customer pssh -H "presto01 presto02 presto03" -l root -A -i "date" | grep '[0-9][0-9]:[0-9][0-9]:[0-9][0-9]' [1] 12:45:45 [SUCCESS] presto01 Sun Jul 14 12:45:45 UTC 2019 [2] 12:45:45 [SUCCESS] presto03 Sun Jul 14 12:45:45 UTC 2019 [3] 12:45:45 [SUCCESS] presto02 Sun Jul 14 12:45:45 UTC 2019 we can do
sshpass -p customer pssh -H "presto01 presto02 presto03" -l root -A -i "date" | grep '[0-9][0-9]:[0-9][0-9]:[0-9][0-9]' | grep -v "^\[" Sun Jul 14 12:50:24 UTC 2019 Sun Jul 14 12:50:24 UTC 2019 Sun Jul 14 12:50:24 UTC 2019 but this is ugly way
| grep 'UTC'?grep -vE '^\[[0-9]+\]'or perhaps justgrep -v '^\['. . . date +%s | grep -xE '[0-9]+'