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 11-17-2008
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,342
If your sed version doesn't support the POSIX Character Classes you can use a space and a \t within the square brackets:


Code:
sed 's/[ \t]*$//'

Older versions of sed even doesn't recognize the \t as a tab. In that case you can type <Ctrl-V> <TAB> successively instead of \t:


Code:
sed 's/[     ]*$//'

Regards

Last edited by Franklin52; 11-17-2008 at 09:26 AM..