help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recursive awk


From: Manuel Collado
Subject: Re: recursive awk
Date: Sun, 20 Dec 2009 11:14:16 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Mathieu escribió:
I wanted to write an awk script to generate an dep list for a latex
file. So I need to match \input{a} and run the same script on a.tex.

The question is how to do awk recursively?

Add "a.tex" to the ARGV array, if not already there:

BEGIN { copy ARGV to dep }

/\\input/ {
   extract file module name = "somename.tex"
   if (!(name in dep)) { add name to ARGV, update ARGC }
}

END {
   for (name in dep) { print name }
}

--
Manuel Collado - http://lml.ls.fi.upm.es/~mcollado


reply via email to

[Prev in Thread] Current Thread [Next in Thread]