Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Wed, 18 Aug 2004 14:32:26 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Hans Horn cc: cygwin AT cygwin DOT com Subject: Re: igawk problem In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 On Wed, 18 Aug 2004, Hans Horn wrote: > Hi Igor, > > thanks for all your insightful advice. > > However, none of your suggestions work ootb. Hans, None of the suggestions were tested. Sorry for missing the "--" in the arg list -- I should have been more careful. > This one doesn't do anything: > > > tmpname=`mktemp` > > gawk -- "$expand_prog" /dev/stdin <$tmpname > > $program > > EOF > > eval gawk $opts -- -f $tmpname '"$@"' \ > > && rm -f $tmpname > > If I understand the gawk man page right, -- is used to indicate the end of > the gawk arg list. > So the order of the args must be changed to > > gawk $opts -f $tmpname -- '"$@"' && rm -f $tmpname > > This happens to work - even under aix! Great. As I remarked in a later e-mail to Yitzchak, using xargs would be equivalent to calling the command from the shell in terms of handling long arguments, anyway, so strike that "solution". The "mktemp" ones seems best for all intents and purposes. If you're *sure* that the script won't be used with stdin, you could try the (suitably modified) third solution, i.e., gawk -- "$expand_prog" /dev/stdin < The next one gives "xargs: argument line too long" : > > > gawk -- "$expand_prog" /dev/stdin < > -- {} '"$@"' $program > > EOF > > You suggested in one of your earlier replies to submit this as a fix > upstream. How does one do that? Well, hopefully, it'll be enough to have posted the solution here, so that the gawk maintainer (Corinna) picks it up and, if she likes it, pushes it upstream... > Would you mind doing it instead? After all, you were really the one that > came up with a solution. We'll see what Corinna says. The above solution does introduce a dependency on mktemp that the gawk maintainers may not wish... Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Happiness lies in being privileged to work hard for long hours in doing whatever you think is worth doing." -- Dr. Jubal Harshaw -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/