Display real-time date changes on Linux

On an embedded Linux device that does not represent /dev/rtc*, how can I configure a console window that writes the value of the real-time clock to the console, on the checkmark, every time it changes?

The results will look like this:

$ **someCmd**
Mon Mar 14 16:43:22 UTC 2011
Mon Mar 14 16:43:23 UTC 2011
Mon Mar 14 16:43:24 UTC 2011
Mon Mar 14 16:43:25 UTC 2011
Mon Mar 14 16:43:26 UTC 2011

and etc.

The device armv5tejlworks with BusyBox v1.13.3.

+3
source share
2 answers

I don’t know how supported the BusyBox shell is, but in sh you can do something like this:

{ while true ; do date ; sleep 0.1 ; done } | uniq
+2
source

Use chat code, try the following: watch -n 1 date

+6
source

All Articles