I have a problem with numerical operations: 1:
echo 12345670 | awk '{ printf "%i\n", $1+1000}'
result:
123466702:
echo 12345670 | awk '{ sub($1,$1+1000); printf "%i\n", $1 }'
result
12346700How can i get correct result in 2 version?
Hello Tmp13, Look here:
# echo 12345 | awk '{ sub($1, $1+1000); printf "%i\n", $1}'
13345You command works fine with lower numbers. I guess 12345670 is quite a big number for "i".
Regds
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |