Re: awk from shell script

From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 11/19/05


Date: Sat, 19 Nov 2005 11:38:24 -0600

Sebastian Luque wrote:
> Hello,
>
> Although I've read advice on this, I'm having trouble setting this up.
>
> I have a file with file names in each row. The listed files are to be
> input for an awk programme. I'm doing it like this:
>
> --8<---------------cut here---------------start------------->8---
> CSV="$(cat $FILES | grep [0-9].csv)"
>
> for i in $CSV; do
> # echo "$i"
> gawk --re-interval -f ~/script.awk "$i" > "${i%.???}_ok.csv"
> done
> --8<---------------cut here---------------end--------------->8---
>
> but this is getting into an endless loop and the output is always empty.
> I'm pretty sure this is a quoting issue, but I can't spot it. Any help is
> appreciated.
>
> Thanks,
>

Are you sure it's an infinite loop? It would just hang with an empty
output file if "$CSV" was empty (i.e. if "$(cat $FILES | grep
[0-9].csv)" returned nothing) - that seems more likely to be your problem.

        Ed.



Relevant Pages

  • Re: awk from shell script
    ... On Sat, 19 Nov 2005 16:38:04 GMT, Sebastian Luque ... > Although I've read advice on this, I'm having trouble setting this up. ... It doesn't look like an endless loop. ...
    (comp.unix.shell)
  • Re: awk from shell script
    ... >> Although I've read advice on this, I'm having trouble setting this up. ... >> but this is getting into an endless loop and the output is always empty. ... infinite loop rather than that your awk script is hanging? ...
    (comp.unix.shell)
  • Re: Active Directory Search for attribute
    ... We are looking to use an existing Active Directory Attribute field but need to be certain that it is not being used. ... If you're going to search an empty attribute for users only (cause you don't care about computers or the data you want to put into that empty attribute isn't applicable to computers, you might want to filter down further: ... ANY advice you get on the Newsgroups should be tested thoroughly in your lab. ...
    (microsoft.public.windows.server.active_directory)
  • Re: HTML::Parser does give any result of its "sub text{...}".
    ... And I apologize because I understood Jenda's advice very slowly. ... If you want an array to start out empty, ... When the condition triggers (if, of course, you choose to use a ...
    (perl.beginners)
  • Serial driver implementation questions
    ... I'm implementing a serial transmit driver for a micro that isn't ... I'd like some advice on it. ... way for the UART empty ISR to get characters to send out. ... int head; ...
    (comp.arch.embedded)