The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
How to remove trailing spaces
.
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
:
How to remove trailing spaces
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
08-09-2007
hegemaro
Registered User
Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
To remove leading spaces, use
tail -1 filename |
sed
-e "s/^ \{1,\}//"
or to removed trailing spaces
tail -1 filename |
sed
-e "s/ \{1,\}$//"
hegemaro
View Public Profile
Find all posts by hegemaro
Find hegemaro's past nominations received
Find hegemaro's present nominations given