Hi i have need of read a file value with cat command and remove first 2character for example cat /sys/class/rtc/day
0x12
Remove char
12
And put this value in a variable
is possible with a script thanks for help
Hi i have need of read a file value with cat command and remove first 2character for example cat /sys/class/rtc/day
0x12
Remove char
12
And put this value in a variable
is possible with a script thanks for help
read VAR < /sys/class/rtc/day
VAR=${VAR:2}
Or
VAR=${VAR#??}
Or
IFS=x read dummy VAR < /sys/class/rtc/day
ok i try
---------- Post updated at 04:44 AM ---------- Previous update was at 02:56 AM ----------
i have a problem because i not have a file.
But i have a result of a command for example:
root@freescale ~$ i2cget -f -y 0 0x51 8
0x12
how can take this value?
thanks
var=$(i2cget -f -y 0 0x51 8|cut -c 3-)
PROBABLY cut -c 2- ?