The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
remove trailing spaces from a line
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
remove trailing spaces from a line
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
11-17-2008
Franklin52
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
..
Franklin52
View Public Profile
Find all posts by Franklin52
Find Franklin52's past nominations received
Find Franklin52's present nominations given