Re: Splitting in shell (bash)

Liste des Groupes 
Sujet : Re: Splitting in shell (bash)
De : mail (at) *nospam* axel-reichert.de (Axel Reichert)
Groupes : comp.unix.shell
Date : 10. Nov 2024, 09:14:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87msi74ia2.fsf@axel-reichert.de>
References : 1 2
User-Agent : Gnus/5.13 (Gnus v5.13)
gazelle@shell.xmission.com (Kenny McCormack) writes:

Kenny McCormack <gazelle@shell.xmission.com> wrote:
mapfile -td ';' < <(someprocess | awk 1 ORS=)

[...]

mapfile -t < <(someprocess | sed 's/;/\n/g')

And in your original post you wrote:

  There is a feature that is prominently missing from the shell language
  (I am speaking primarily of bash here) - which is the ability to split
  a string on a delimiter. This is a common operation in most other
  text-processing oriented languages (AWK, Perl, etc).

So why bother with a shell solution and why bother with avoiding IFS,
when in the end you need to resort to AWK/sed anyway?

Do not get me wrong, I am learning a lot in this thread here, much of
the stuff is far beyond my level of expertise in shell programming, and
it would be great to have a shell-only solution for your inquiry, even
if only for "academic reasons" because, say, the solution (still to
come) may turn out to be too clumsy for daily use). I will applaud such
a result, but for the time being I would be happy if you could elaborate
somewhat more about your motivation for this exercise.

Best regards

Axel

Date Sujet#  Auteur
9 Nov 24 * Splitting in shell (bash)11Kenny McCormack
10 Nov 24 +* Re: Splitting in shell (bash)4Lem Novantotto
10 Nov 24 i`* Re: Splitting in shell (bash)3Lawrence D'Oliveiro
10 Nov 24 i +- Re: Splitting in shell (bash)1Lem Novantotto
17 Nov 24 i `- Re: Splitting in shell (bash)1Jerry Peters
10 Nov 24 `* Re: Splitting in shell (bash)6Kenny McCormack
10 Nov 24  `* Re: Splitting in shell (bash)5Axel Reichert
10 Nov 24   +* Re: Splitting in shell (bash)3Janis Papanagnou
10 Nov 24   i`* Re: Splitting in shell (bash)2Kenny McCormack
10 Nov 24   i `- Re: Splitting in shell (bash)1Janis Papanagnou
9 Dec 24   `- Re: Splitting in shell (bash)1Kenny McCormack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal