in reply to How to use print and pipe it to awk ?

As others have mentioned, but not elaborated on, you can achieve all of this in Perl without resorting to Awk. Something like this (not tested)

#!/usr/bin/perl use strict; use warnings; my $dir = q{/path/to/dir}; my $t_spec = q{xyz}; my $part_no = q{123AZ789}; my $chg_lvl = q{3.2}; my $int_lock = q{LLL}; my $errFile = qq{/$view_tag/app_hwt/heavy_duty/part_no_update.err}; open my $errFH, q{>>}, $errFile or die qq{append: $errFile: $!\n}; my $errFormat = qq{%-13s %10s %7s %5s %4s - %5s\n}; printf $errFH $errFormat, $dir, $t_spec, $part_no, $chg_lvl, $int_lock, q{error}; close $errFH or die qq{close: $errFile: $!\n};

Hopefully, this will get you started on the task of doing the whole thing in Perl.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: How to use print and pipe it to awk ?
by sas429s (Novice) on Jan 24, 2008 at 16:53 UTC
    Thank you all for the reply. I will try this one out and let you know. Thanks Again