Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add new line at the end with awk

I was searching and trying a lot of different approaches, but non of them really did what I need. Hopefully it was not asked million times before.

I have this alias in my bashrc:

alias temp='awk '\''{ printf ("%0.1f",$1/1000); }'\'' < /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input'

output of it is:

measure@remote ~ $ temp
10.6measure@remote ~ $

what I'm trying to achieve is ouput like this:

measure@remote ~ $ temp
10.6
measure@remote ~ $
like image 884
fluffypuffy Avatar asked Dec 07 '22 15:12

fluffypuffy


1 Answers

Replace

"%0.1f"

with

"%0.1f\n"
like image 145
Cyrus Avatar answered Jan 02 '23 00:01

Cyrus