Re: awk from shell script
From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 11/19/05
- Next message: Ed Morton: "Re: awk from shell script"
- Previous message: Sebastian Luque: "awk from shell script"
- In reply to: Sebastian Luque: "awk from shell script"
- Next in thread: Ed Morton: "Re: awk from shell script"
- Reply: Ed Morton: "Re: awk from shell script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Ed Morton: "Re: awk from shell script"
- Previous message: Sebastian Luque: "awk from shell script"
- In reply to: Sebastian Luque: "awk from shell script"
- Next in thread: Ed Morton: "Re: awk from shell script"
- Reply: Ed Morton: "Re: awk from shell script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|