Re: awk command in script?

2008-11-21 Thread John W. Krahn
Owen wrote: You need to run something like this. Adapt to your requirements #!/usr/bin/perl -w use strict; while () { my $line = $_; if ( $line =~ /QQQ/ ) { my @bits = split; print "$bits[$#bits -1]\n";

Re: awk command in script?

2008-11-21 Thread marys
On Nov 21, 4:47 pm, [EMAIL PROTECTED] (Owen) wrote: > On Fri, 21 Nov 2008 03:41:21 -0500 > > > > > > "michael spellman" <[EMAIL PROTECTED]> wrote: > > On Thu, Nov 20, 2008 at 8:32 PM, Owen <[EMAIL PROTECTED]> wrote: > > > > On Thu, 20 Nov 2008 06:32:51 -0800 (PST) > > > marys <[EMAIL PROTECTED]> wr

Re: awk command in script?

2008-11-21 Thread marys
On Nov 20, 4:58 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > marys wrote: > > Hello: > > Hello, > > > Does anyone know how to use ‘awk’ in a script? > > perl and awk have a lot of similar features so its usually preferable to > use perl in a perl program instead of awk. > > > It must have a > > d

Re: awk command in script?

2008-11-21 Thread Owen
On Fri, 21 Nov 2008 03:41:21 -0500 "michael spellman" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 20, 2008 at 8:32 PM, Owen <[EMAIL PROTECTED]> wrote: > > > On Thu, 20 Nov 2008 06:32:51 -0800 (PST) > > marys <[EMAIL PROTECTED]> wrote: > > I am not altogether certain what you are trying to achieve.

Re: awk command in script?

2008-11-20 Thread Owen
On Thu, 20 Nov 2008 06:32:51 -0800 (PST) marys <[EMAIL PROTECTED]> wrote: > Hello: > Does anyone know how to use ‘awk’ in a script? It must have a > different syntax than the unix analog, as does the ‘grep’ command. > For grep, the syntax in the c-shell is: > “grep ‘string’ , but for Perl the del

Re: awk command in script?

2008-11-20 Thread John W. Krahn
marys wrote: Hello: Hello, Does anyone know how to use ‘awk’ in a script? perl and awk have a lot of similar features so its usually preferable to use perl in a perl program instead of awk. It must have a different syntax than the unix analog, as does the ‘grep’ command. For grep, the s

awk command in script?

2008-11-20 Thread marys
Hello: Does anyone know how to use ‘awk’ in a script? It must have a different syntax than the unix analog, as does the ‘grep’ command. For grep, the syntax in the c-shell is: “grep ‘string’ , but for Perl the delimiters are slashes: $x = grep / string/ line. Maybe the same thing is going on with