[HOW TO] ts: command not found and how to fix?

Hi Everybody,

I have been writing the script to get latency networking. And I have a interesting thing. So, here is a part of script:
#!/bin/bash
while true; do
        ping -w 3600 example.com |
        ts '%Y-%m-%d %H:%M:%S |' |
        tee -i -a /home/cattek/Scripts/Logs/ping.log
done

ts: command not found

What is "ts"? to simplify I type apt-cache search ts. But nothing to show. Where can I find it?

Googled, I know "ts" includes in moreutils library. It utilities package every UNIX/Linux/MacOS developer should know (I'm not developer lol). It is a growing collection of the unix tools that nobody thought to write long ago when unix was young.

The moreutils tools includes:
  • chronic
  • combine
  • errno
  • ifdata
  • ifne
  • isutf8
  • lckdo
  • mispipe
  • parallel
  • pee
  • sponge
  • ts
  • vidir
  • vipe
  • zrunts: command not found
It enoughs to continue,
apt-get install moreutils

Now everything looks like good. I have to run this script. Good, nothing error to show.

Above article is very simple when we see it. I think about this, and write blog.

Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success
  

0 nhận xét:

Post a Comment