tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Sorting in BASH

lack of space & pipes ▻

Sorting in BASH

In article <03793b48.45762eec@usw-ex0106-048.remarq.com>,
Bash  <kumar_amit_inNOkuSPAM@hotmail.com.invalid> wrote:
>Since the BASH has not support any array, I can't understand where to
>start ! Any guidence will help a lot!

Shells use a rather different paradigm to most programming languages.
They don't support complicated data structures, but they are very
good at manipulating streams of data.  Typically the data streams are
minimally structured: each line of text is a "record".

    $ cat lamb
    Mary
    had
    a
    little
    lamb

    $ sort lamb
    a
    had
    lamb
    little
    Mary

The plethora of options to `sort' allows you to sort data streams with
more complicated structures: fields within records, etc.

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: Sorting in BASH
Date: 23 Mar 2000 10:01:40 -0000
Message-ID: <8bcq2q$ega$1@ltpcg.star.le.ac.uk>
References: <01156d94.8185b023@usw-ex0107-050.remarq.com>
  <8basro$c58$1@ltpcg.star.le.ac.uk>
  <03793b48.45762eec@usw-ex0106-048.remarq.com>

△ comp.unix.shell △

◅ Sorting in BASH

lack of space & pipes ▻