View Single Post
Old 02-15-2017, 04:08 AM   #26
Hanspeter
Connoisseur
Hanspeter doesn't litterHanspeter doesn't litter
 
Posts: 77
Karma: 150
Join Date: Jul 2014
Device: Kindel PW1, Voyager
Quote:
Originally Posted by knc1 View Post
Format character: %I hour (01..12)
Hint:
man date
In either a full Linux install or in a web search engine.
I read the man page ans in now the formatting commands and use Linux Ubuntu since 10 years as my main system and on servers..
There is a command that give the time in local (24 or 12AM/PM) format. But only with seconds.

The command that I reused to grep the right statements and display the data is highly complex from my point of view. I was not able until now to find a solution how to strip the seconds or use different formats in depends of the local settings

Code:
		# This next part says, "Clear Log" then 
		# "Push the new log, line by line, into awk" then 
		# "If a certain line is matched by awk get awk to run eips via the shell"	
		&> /var/log/messages && 2>/dev/null tail -F /var/log/messages | exec parselog | \
		awk '/.*PageTurnAction*./ || /.*JunoExecutionManager*./  {system("eips ${POS} ${ROW} `date +%H:%M`-`gasgauge-info -s`")}'
		exit 0

HaPe
Hanspeter is offline   Reply With Quote