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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=kCZty3oSfIVwinBcLEwtmsixKVmbX41SOjUwDcIhQiF TBEUKJS934JNtiFZyTUy95w707kyM48Fs3j3cW8H+zOHSUcNpi2c4WpHzw4fk1vf UIwCsLKt2W4TgK0DXJk1F87TC+nHEmJFZ81jzzdjmmXhVlFp1YC+2/KYwPmp4cBA = 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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=nQLqDIcHgD2IQOEYfERuCuTOO7E=; b=s458PQnAf4epf7TVE m4P75J2Yo7/Pi7p6vMeGi1fCtlUdFNO9ilym2A0C2X6hGvl1ApLT68/XMKGeaUm4 C5HtLNamuYEXgJ9FoPlVWiMy4ly1i2Uieqo5yA/L8b3gTXTkUL0NYBEFVQ91+ZRE FJJ8M7ZFqftOT6OadIn0JrLVTI= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: limerock02.mail.cornell.edu X-CornellRouted: This message has been Routed already. Message-ID: <5439C8A6.5020605@cornell.edu> Date: Sat, 11 Oct 2014 20:17:42 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 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> In-Reply-To: <5439C59F.5060308@molconn.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes On 10/11/2014 8:04 PM, LMH wrote: > Hello, > > I have been working on a bash script and suddenly I started getting an > error that ls could not be found, > > ./remove_rows.sh: line 27: ls: command not found > > I can run ls from the command line just fine. There is also an ls > command before line 27 that runs fine. This is the part of the script > that is causing problems (line numbers are included). > > 24 PATH=$(ls -d './'$SET'/'$FOLD'/'$FOLD'_anneal/'$PARAM_SET'/'$AN_SET) > 25 echo $PATH > 26 > 27 FILE_LIST=($(ls $PATH'/'*'out.txt')) > 28 echo ${FILE_LIST[@]} > > The echo $PATH command gives the correct output, but I get the error on > line 27. I have tried without the double parentheses, which wouldn't > give the result I want, > > FILE_LIST=$(ls $PATH'/'*'out.txt') > > but this gives the same error. > > After this problem happened, I updated cygwin and restarted, but the > issue persists. Is there something wrong with my cygwin install? If > there happens to be some problem with my bash, please let me know, but > this is pretty simple stuff and I just can't see why ls would be found > at line 24 but not line 27. You've changed PATH in line 24. Is 'ls' still in it? Ken -- 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