delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/10/12/04:35:45

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:references:date:in-reply-to
:message-id:mime-version:content-type; q=dns; s=default; b=ZVZxx
M6DPyLtkQd/+gIVafTMFwfK1D1NHpdJ456ez7vADJETeXlwJPvtZu0+ljkE+fstg
Bp+lADc+zCwvvahLSZsQuha9aNAOQzHB1tL89JCklemO+OFsvhwXMPqLeww/0tBn
YPbmd832BphI3M4MwlIX8JeHADhJUNFnri2rqU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:references:date:in-reply-to
:message-id:mime-version:content-type; s=default; bh=7GzuLbDhavj
mITz9O3MLanl+4bs=; b=jUc9eMGZhjUQlMWcfC41B505AP8eJNv5DyfBGS2QeTK
hafLkVrxhJsZEN5CiQJd1Pt3SdC/kllB/pTmkpYjiIvCWcLdkDRpAgr0RXnergo9
BsID9VyYg9gOUtDQ+wY0BsaCLHiqfwIxnq248ie38dBZu64d4N+KW3LMdVTEI6l8
=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-in-08.arcor-online.net
X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-14.arcor-online.net 230929BE07
From: Achim Gratz <Stromeko AT nexgo DOT de>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin bash script suddenly can't find ls, grep
References: <5439C59F DOT 5060308 AT molconn DOT com> <5439C8A6 DOT 5020605 AT cornell DOT edu> <5439CB8F DOT 9000708 AT molconn DOT com>
Date: Sun, 12 Oct 2014 08:08:07 +0200
In-Reply-To: <5439CB8F.9000708@molconn.com> (LMH's message of "Sat, 11 Oct 2014 20:30:07 -0400")
Message-ID: <87fvetes6w.fsf@Rainer.invalid>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (gnu/linux)
MIME-Version: 1.0

LMH writes:
> Good Lord, I guess I wasn't thinking very clearly trying to use PATH as
> a variable for something else. I changed to,
>
> FILE_DIR=$(ls -d './'$SET'/'$FOLD'/'$FOLD'_anneal/'$PARAM_SET'/'$AN_SET)
> echo $FILE_DIR
>
> FILE_LIST=($(ls $FILE_DIR'/'*'out.txt' ))
> echo ${FILE_LIST[@]}
>
> and everything is fine. I guess it was a bash issue after all. Thanks
> for checking that out.

Are you trying to re-write some Windows BAT/CMD script perhaps?  It
seems that you'd actually want to use find instead of ls and protect
yourself a bit against the possibility of one of these path or file
names containing whitespace.  The ls constructing FILE_LIST is probably
not needed because the shell already globs the file names before ls ever
gets to it.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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