SUMMARY: ZSh question

From: Nikola Milutinovic <Nikola.Milutinovic_at_ev.co.yu>
Date: Thu, 12 Oct 2000 13:50:54 +0200

Hi all.

Many responses in a short time. :-)

Thanks to:
        Jean-Pol.Guillement_at_math.univ-nantes.fr (Jean-Pol Guillement)
        "Gavin Kreuiter" <gavin_at_transactive.usko.com>
        "Rost, Werner" <Werner.Rost_at_boge.mannesmann.de>
        "Frank-Peter Reich" <frank-peter.reich_at_nowis.de>

The first three respondants gave a working solution:

cat file.cfg | wnile read i
  do
  ...
  done

Frank sugested PERL solution:

#!/usr/bin/perl

_at_file_array = <file.cfg>; # Read in the complete File

foreach (_at_file_array) { # Complete line is in the implizit
variable $_

   my ($item, $value) = split(); # Split $_ in the other variables

   ... # Do anything with the variables
}

Thank you all. I have already found an awk workaround for my problem,
but I'll keep this in mind in the future. Heck, I might even switch back
to ZSh builtins. Or switch forward, to Perl :-)

Nix.
-- 
"When you find that your views match [those of] the majority, it's
     time to pause and reflect."  -- Samuel L. Clemens, a.k.a. Mark
Twain
Received on Thu Oct 12 2000 - 11:47:24 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT