unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Harald Hanche-Olsen <hanche@math.ntnu.no>
To: help-gnu-emacs@gnu.org
Subject: Re: how to sort words in a line
Date: Tue, 17 Jul 2007 15:46:54 +0200	[thread overview]
Message-ID: <pcoabtvcfch.fsf@shuttle.math.ntnu.no> (raw)
In-Reply-To: 87r6n7l41m.fsf@thalassa.lan.informatimago.com

+ 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	other threads:[~2007-07-17 13:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 10:01 how to sort words in a line Rainer Stengele
2007-07-17 10:26 ` Pascal Bourguignon
2007-07-17 13:46   ` Harald Hanche-Olsen [this message]
2007-07-17 17:54     ` Rainer Stengele
2007-07-17 20:12       ` Harald Hanche-Olsen
2007-07-17 17:57   ` Rainer Stengele
2007-07-17 18:07     ` Pascal Bourguignon
2007-07-17 18:20       ` Rainer Stengele
2007-07-17 19:20     ` Thien-Thi Nguyen
2007-07-17 22:43     ` Nikolaj Schumacher
2007-07-18  7:21     ` Mathias Dahl
2007-07-18 19:25       ` Rainer Stengele

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pcoabtvcfch.fsf@shuttle.math.ntnu.no \
    --to=hanche@math.ntnu.no \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).