The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
Order sorting
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Portal
Register
Forum Rules
FAQ
Contribute
Members List
Arcade
Search
Today's Posts
Mark Forums Read
Thread
:
Order sorting
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
12-02-2005
vino
Supporter (in vino veritas)
Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,661
I dont think sed alone has the power to do that.
But couple it along with other tools and it can be done.
The result follows the spacing pattern of the input.
Code:
[~/temp]$ echo "01 B D A C" | sed -e 's/ /\n/g' | sort | tr '\n' ' ' 01 A B C D
vino
View Public Profile
Find all posts by vino