help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to sort words in a line


From: Harald Hanche-Olsen
Subject: Re: how to sort words in a line
Date: Tue, 17 Jul 2007 15:46:54 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix)

+ Pascal Bourguignon <pjb@informatimago.com>:

| Rainer Stengele <rainer.stengele@diplan.de> writes:
|> I just couldn't find a fast solution to sort a line of words:
|>
|> zzz aaa hhhh
|>
|> -->
|>
|> aaa hhhh zzz
|>
|>
|> Did I miss a simple command?
|
| AFAIK, no.
|
| But it's rather simple a command to write:

You could also pipe the line through the command

  tr ' ' \n | sort | tr \n ' '

or variations thereof, depending on your shell's ability to interpret
escape sequences like \n.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


reply via email to

[Prev in Thread] Current Thread [Next in Thread]