1.echo string|awk '{print substr(,length()-1,length())}'2.echo string|sed 's/\(.*\)\(..$\)//'3.echo string|rev|cut -c-2|rev4.echo $-2)):2}或echo $5.echo string|grep -o ..$6.echo string|rev|colrm 3|rev7.expr string : ".*\(..\)$"
原文转自:http://www.ltesting.net