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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -