How do i write awk commands in perl.
a2p
Oh, sorry that's not the question you were asking. But come to think
of it, it probably is at least part of the answer to the question you
_should_ have been asking.
Can i do something like this system("awk '{print $3}'"); for example
Well, obviously you'd have to remember that $ is meta in perl
double-qouted strings.
system("awk '{print \$3}'");
OR
system('awk','{print $3}');
But you could only do this if you wanted awk's STDIN and STDOUT to be
simply connected to the current process's STDIN and STDOUT and for the
current process to wait for the subprocess to finish.
This is an untterly improbable thing to want to do. The again piping
to or from the above script in Perl is an equally improbable thing to
want to do as it's trivial to do the same in thing directly in Perl.
or do i have to use qx or something else.
If you want to redirect the STDIN and/or STDOUT of a child process in
Perl the you need something other than system(). This, of course, has
nothing to do with awk.
Have you considered reading the manual at all?
I am not able to use any awk commands.
Why? What happens when you try? Do your hands rebel and refuse to
type the commands? It could be that your subcouncious knows you
should use Perl so is paralysing your hands.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\