The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-18-2008
era
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
The subject says "last line of word" and the text says "a character". We can speculate that this means the last character of each line, or of each word ...?


Code:
sed -e 's/.$//'   # last character
sed -e 's/.\( \|$\)//'  # every character before a space or end of line

Does this get you moving in any particular direction ...?

Last edited by era; 03-18-2008 at 11:42 AM.. Reason: Backslash key got borked \-: