in reply to perl to run awk and sed
perl can do all of this internally.
Why don't you show us a few lines of your input you're sending to these commands, your expected output after they're processed, and we'll see if we can avoid you shelling out?
Here's an attempt of what I think you want though:
use warnings; use strict; my @lines = ( # where '\t' is a real tab "one\ttwo\tthree", "four\tfive\tsix", ); for my $line (@lines){ my $str = (split /\t/, $line)[0]; $str =~ s/.$//; print "$str\n"; } __END__ on fou
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl to run awk and sed
by deelinux (Novice) on Nov 30, 2015 at 17:39 UTC | |
by stevieb (Canon) on Nov 30, 2015 at 17:42 UTC | |
by GotToBTru (Prior) on Dec 01, 2015 at 15:26 UTC | |
by deelinux (Novice) on Nov 30, 2015 at 20:15 UTC | |
by stevieb (Canon) on Dec 01, 2015 at 01:15 UTC | |
|
Re^2: perl to run awk and sed
by deelinux (Novice) on Nov 30, 2015 at 17:40 UTC | |
by Laurent_R (Canon) on Nov 30, 2015 at 18:26 UTC | |
by stevieb (Canon) on Nov 30, 2015 at 18:49 UTC |