delorie.com/archives/browse.cgi | search |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <4993126.post@talk.nabble.com> |
Date: | Thu, 22 Jun 2006 06:26:34 -0700 (PDT) |
From: | ydubost <yann DOT dubost AT capgemini DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Pb with bash script under cygwin |
In-Reply-To: | <4934908.post@talk.nabble.com> |
MIME-Version: | 1.0 |
X-Nabble-Sender: | yann DOT dubost AT capgemini DOT com |
X-Nabble-From: | ydubost <yann DOT dubost AT capgemini DOT com> |
References: | <4934908 DOT post AT talk DOT nabble DOT com> |
X-IsSubscribed: | yes |
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 |
Hello, Thank you for all your suggestions. I have finally managed to do what I wanted. There was several reasons: 1) the different -name options of find have to be enclosed in protected bracket \( ... \) 3) the need to use the eval function 2) in a script, one need to protect the different special characters from being interpreted before the final command. For exemple, I have to write \\\( in order to obtain \(. The problem, is that I don't really understand what happens, why I nedd to put 3\ and not 2 or 4, but the main point is that it now works. my new script is : TYPELIST="._bc ._ch ._cl ._cm ._df ._dl ._ev ._fl ._gr ._hl ._is ._mb ._mm ._mp ._ov ._pr ._sn ._sy ._ti ._tr ._sf" Extension=$(echo ${TYPELIST} | sed -e"s:[ ][.]:' -delete \\\) -o \\\( -iname '*.:g" | sed -e"s:^[.]:\\\( -iname '*.:" | sed -e"s:$:' -delete \\\):") MaCommande="find . ${Extension}" eval ${MaCommande} -- View this message in context: http://www.nabble.com/Pb-with-bash-script-under-cygwin-t1810878.html#a4993126 Sent from the Cygwin Users forum at Nabble.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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |