delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/25/05:37:11

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Danilo Turina <danilo DOT turina AT alcatel DOT it>
Subject: Re: bash: simple command problem
Date: Fri, 25 Jun 2004 11:40:23 +0200
Lines: 43
Message-ID: <40DBF307.9090204@alcatel.it>
References: <AE9593E6D161544D82CEFCA0552EEAAE013DECFD AT ebexbn01 DOT dpeb DOT de>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: hydra01.alcanet.it
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616
In-Reply-To: <AE9593E6D161544D82CEFCA0552EEAAE013DECFD@ebexbn01.dpeb.de>

This is not specifically related to Cygwin.

Anyway, your command does not work because the variables (variableA and 
nextVariable) are expanded by Bash before the line is executed (as always).

In fact, something like this would work:

variableA=valA nextVariable=next eval 'echo $variableA $nextVariable'

Ciao,

		Danilo

cygwin DOT 20 DOT job AT spamgourmet DOT com wrote:

> Hi Folks
> 
> I hove the problem to set variable in front of executing a command. The
> bash manpage says that a simple command is a set of variable assignment
> followed by the command
> 
> So I think that
> 
> variableA=valA nextVariable=next echo $variableA $nextVariable
> should echo valA next but when I try this in the bash the echo is empty
> 
> Did I understand something wrong or is it a bug?
> 
> Regards 
> 
>     Franz
> 
> 


-- 
--------------------------------------
Danilo Turina
Alcatel Optics OND Network Management
Rieti (Italy) - Phone: +39 0746 600332
--------------------------------------

3 anni 2 mesi 16 giorni 2 ore 5 minuti 45 secondi


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019