tenox7 / ttyplot

a realtime plotting utility for terminal/console with data input from stdin
Apache License 2.0
961 stars 43 forks source link

Ping example on mac #48

Closed abhatikar closed 4 years ago

abhatikar commented 4 years ago

The ping example does not seem to work on mac terminal. Is it something related to buffered output ? also sed on mac does not have the option of -u .

Thanks in advance..

abhatikar commented 4 years ago

for now I am using a work around by creating a wrapper script and then piping it with ttyplot. Btw I did try the stdbuf -o0 but it did not work for me. Any help or guidance would be appreciated.

#!/bin/bash

while [ 1 ];
do
    value=$(ping -c 1  8.8.8.8 | sed 's/^.*time=//g; s/ ms//g' | awk '{ print $1 }' | sed -n 2p)
    sleep 1
    echo $value
done
tenox7 commented 4 years ago

I have not tried ping on mac, let me try to figure it out

tenox7 commented 4 years ago

on a mac just change -u to -l in sed

tenox7 commented 4 years ago

I have updated the readme. Closing ticket, please re-open if any issues.

abhatikar commented 4 years ago

sweet.!