Extracting latency value from output of ping I am trying to pull a latency value from a ping with the following command:

ping -c 1 206.190.36.45 | awk -F" |=" '/time/{print $10"ms YH"}'

But I want to remove the digits after the .

So instead of 282.117ms US

I would like to see 282ms US

What needs to be added to the command to do so?
There are probably hundred of ways to accomplish this with standard Unix tools. To list just some of them:
# extending what you have
ping -c 1 206.190.36.45 | awk -F&quot; |=&quot; '/time/{print $10&quot;ms YH&quot;}' | sed -e 's/\..*ms/ms/

# using awk only
ping -c 1 206.190.36.45 | awk -F&quot; |=&quot; '/time/{printf &quot;%i%s\n&quot;, $10, &quot;ms YH&quot;}'

# using sed instead
ping -c 1 206.190.36.45 | sed -n 's/.*time=\(.*\)\..*/\1ms YH/p'

# a rather different approach (just for the fun of it, not really recommended)
echo &quot;$(ping -c 1 206.190.36.45 | fgrep time= | cut -d= -f 4 | cut -d. -f 1)ms YH&quot;