I have a string and I want to extract the last 3 characters. x=`echo
$i | awk '{print substr($0,-3,3)}'`
That is not doing it......
Does the following work?
awk '{print substr($0,length($0)-3,3)}'
Rui maciel
or, gawkally:
$ echo "lets figure it." | awk '{print substr($0,NF-2,3)}' FS=''
it.