[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cut -c
Charles Menzes said:
> Is there a way to cut the back 3 characters on various strings?
Take your pick:
rev | cut -c-3 | rev
sed 's/^.*\(...\)$/\1/'
perl -lpe 's/^.*(.{3})$/$1/' # The -l might not be necessary.
perl -lne 'print substr($_, -3);'
Personally, I'd probably do the last one.
Steve
--
steve@silug.org | Linux Users of Central Illinois
(618)398-7320 | Meetings the 4th Tuesday of every month
Steven Pritchard | http://www.luci.org/ for more info
-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.
- References:
- cut -c
- From: Charles Menzes <charles@lunarmedia.net>