AWK tutorial: awk remove last character

awk remove last character

use awk length and substr functions

➜  ~ echo "asdfsdfsf" | awk '{t=length($0)}END{print substr($0,0,t-1)}'

Add a Comment

Your email address will not be published.