delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/19/08:11:06

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Pb with bash script under cygwin
Date: Mon, 19 Jun 2006 13:10:49 +0100
Message-ID: <002901c69399$67131120$a501a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4934908.post@talk.nabble.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On 19 June 2006 12:45, ydubost wrote:

> Hello there,
> 
> I have been working on a very simple script for 3 hours not been able to
> understand what's wrong with it.

  Run it under "bash -x" to see what's actually being executed and so what's
going wrong.


> TYPE_FIC_UPPER="._BC ._CH ._CL ._CM ._DF ._DL ._EV ._FL ._GR ._HL ._IS ._MB
> ._MM ._MP ._OV ._PR ._SN ._SY ._TI ._TR"
> TYPE_FIC_LOWER="._bc ._ch ._cl ._cm ._df ._dl ._ev ._fl ._gr ._hl ._is ._mb
> ._mm ._mp ._ov ._pr ._sn ._sy ._ti ._tr"
> TYPELIST=${TYPE_FIC_UPPER}" "${TYPE_FIC_LOWER}
> 
> Extension=$(echo ${TYPELIST} | sed -e's:[ ][.]:" -o -name "*.:g' | sed
> -e's:^[.]:-name ":' | sed -e's:$:":')
> MaCommande="find . ${Extension} -exec rm {} \; -print"
> 
> echo -e " - lancement de la commande=\n[${MaCommande}]\n" # display OK !
> 
> $(${MaCommande}) # ne fonctionne pas !
  ^^^^^^^^^^^^^^^

  Don't you just want "${MaCommande}" on it's own?  Or "$(echo ${MaCommande})"
perhaps?

> find . ${Extension} -exec rm {} \; -print # ne fonctionne pas non plus !

  Do any of the filenames or subdirectories have spaces or other special
characters?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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