Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3E6CAC32.9040109@isg.de>
Date: Mon, 10 Mar 2003 16:16:02 +0100
From: Tino Lange <tino.lange@isg.de>
Organization: IS Innovative Software AG
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210
X-Accept-Language: de, en-us, en, fr
MIME-Version: 1.0
To: cygwin@cygwin.com
Cc: hauser@acm.org
Subject: Re: cygpath "$@" in a script: bug?
References: <Pine.GSO.4.44.0303101001390.11568-100000@slinky.cs.nyu.edu>
In-Reply-To: <Pine.GSO.4.44.0303101001390.11568-100000@slinky.cs.nyu.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Then you will call cygpath x-times, which is quite inefficient for large 
globbing with wildcards.

Better do something like

*** snip ***

#! /bin/sh
for file in "$@"; do
   memfile="${memfile:-""}$file\n"
done
<application> $(echo -e "$memfile" | cygpath -w -f -)

*** snip ***

which results in just one call via an in -memory file-list.

Tino


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

