Create functional processing pipe (without eval)?

Liste des GroupesRevenir à cu shell 
Sujet : Create functional processing pipe (without eval)?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell
Date : 07. May 2025, 03:02:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vveev6$dll3$1@dont-email.me>
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
I'm pondering about creating a functional processing pipe, depending
on program parameters, and whether that's possible to achieve without
using 'eval'.

Say, the program is called "filter" and may accept 0..N parameters and
depending on the set of parameters the respective pipe functionality
shall be defined like

  filter               =>  cat
  filter p1            =>  cat | func p1
  filter p1 p2         =>  cat | func p1 | func p2
  filter p1 p2 ... pN  =>  cat | func p1 | func p2 | ... | func pN

where "func" is working as filter and accepts exactly one parameter.

(Because of reservations I have with 'eval' and quoting I'd like to
avoid that 'eval' indirection if possible.)

I think it's [in principle] not possible [without 'eval'] in shell
(POSIX, Ksh, Bash) but I'm interested to hear opinions...

Janis

Date Sujet#  Auteur
7 May 25 * Create functional processing pipe (without eval)?10Janis Papanagnou
7 May 25 +* Re: Create functional processing pipe (without eval)?2Kaz Kylheku
7 May 25 i`- Re: Create functional processing pipe (without eval)?1Janis Papanagnou
7 May 25 +* Re: Create functional processing pipe (without eval)?3Lars Poulsen
7 May 25 i`* Re: Create functional processing pipe (without eval)?2Janis Papanagnou
7 May 25 i `- Re: Create functional processing pipe (without eval)?1Janis Papanagnou
7 May 25 `* Re: Create functional processing pipe (without eval)?4Ben Bacarisse
7 May 25  `* Re: Create functional processing pipe (without eval)?3Janis Papanagnou
7 May 25   `* Re: Create functional processing pipe (without eval)?2Christian Weisgerber
7 May 25    `- Re: Create functional processing pipe (without eval)?1Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal