Remove last character of line

kshell:
x=${x%?}

vi:
:%s/.$//g

sed:
x=`echo $x | sed s/.$//`

Trackback URL

No Comments on "Remove last character of line"

Hi Stranger, leave a comment:

ALLOWED XHTML TAGS:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to Comments