Issue
well hello there ! I'm pretty new on linux and I need some help with this... I tried severals commands like sed or tr to solve it unsuccessfuly... I didn't solve anything.. I want to go from this display for
"timedatectl timesync-status"
to this one
"34min 8s (min: 32s; max 34min 8s);normal;4;2;91EECB0E;1us (-24);78.688ms (max: 5s);-50.923ms;103.234ms;25.637ms;70;-5,050ppm"
so I would to take off the "Server: Poll interval: Leap: Version: Stratum: Reference: Precision: etc etc"
Some help would be very appreciated ! thanks for your time and your help
Solution
timedatectl timesync-status | awk -F: 'NR==1 { printf "%s",substr($2,2);next } { printf ";%s",substr($2,2)}'
Pipe the output through to awk. Set the field delimiter to : For the first line/record in the output, strip the leading space from the second field and print the field. For all other lines do the same but print the field prefixed with ;
Answered By - Raman Sailopal Answer Checked By - Terry (WPSolving Volunteer)