Here's an excerpt of some commands that I've been trying to evaluate from a Zsh script:
cmd="ping -qc 3 -W 5 8.8.8.8 | xargs -0d '\n' awk -f presetup/testping.awk 2>&1"
print -r ${cmd}
output=$(eval ${cmd})
print ${output}
I don't know what I'm missing but, all I'm trying to do is to process the stderr & stdout of ping with a single awk script. Here's the output I'm getting:
awk: presetup/testping.awk:6: fatal: cannot open file `PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.' for reading (No such file or directory)
The program is supposed to parse each output line of the ping command and match with regular expressions its output. Any ideas of what I'm missing?