unix - Trim last 3 characters of a line WITHOUT using sed, or perl, etc -
i've got shell script outputting data this:
1234567890 * 1234567891 *
i need remove last 3 characters " *". know can via
(whatever) | sed 's/\(.*\).../\1/'
but don't want use sed speed purposes. same last 3 characters.
any quick way of cleaning output?
assuming data formatted example, use 'cut' first column only.
cat $file | cut -d ' ' -f 1
or first 10 chars.
cat $file | cut -c 1-10
Comments
Post a Comment