X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 	tests=AWL,BAYES_00,J_CHICKENPOX_33,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <49F98B26.2070007@cornell.edu>
References: <49F98B26.2070007@cornell.edu>
Date: Thu, 30 Apr 2009 10:09:35 -0400
Message-ID: <f60fe000904300709m301afdc6j70f39327f640a538@mail.gmail.com>
Subject: Re: Bash problem
From: "Mark J. Reed" <markjreed@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Thu, Apr 30, 2009 at 7:27 AM, Ken Brown
> A build script I was running failed because it had a command of > the form 'eval foo=bar time <command>'.

That won't work because time is a special shell keyword, and as such
only recognized when it's the first word on the command line. The same
is true of all shell syntax-driving keywords such as "case", "for",
"while", etc.  (But not for simple built-in commands, which can appear
anywhere the name of an actual command program on disk can).

> I have access to a linux system in which the original command > (with foo=bar) works.

That just means that the Linux system has the standalone time(1)
command installed.  As it happens, my Cygwin install also has a
/bin/time.

You can just move the assignment to after the 'time':

eval time foo=bar env | grep foo

real    0m0.120s
user    0m0.000s
sys     0m0.078s
foo=bar



-- 
Mark J. Reed <markjreed@gmail.com>

--
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/

