X-Recipient: archive-cygwin@delorie.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=uz8CALr31x8H16YMzCUs0ywIiA6qVzInDelaM7YR/Fi
	80u1jxgO3y9CAsBMHxbkADfGI7VUlroxHcRy5tLaYO0+FxAUiOOqmjzIKzEdd+A8
	D4BKB6HroTyguShhyMx8WvXFT3lnL/s8vjR/X0laZ3MeTMyCTyxZoRDcKBCHYbrM
	=
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=idwaN7JpfGx7WongMNCAMxil57c=; b=JG/8frOxlU81BIbOF
	pPWWUVALpBeIrYd1sEgqoBK8LRoG7g9BYWr1gaPs63DSMcSOacpQnlmLol0bcjeO
	GDpxQHfOICkCz7o9E+cqB6FHv68WFH0xfUI5b7g4/Se+3T1N68iv7Z0ItOln6Yhd
	LBw/qs8m68wK3T6ILG02WpfYto=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_05,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.1
Message-ID: <51B68398.5070207@tlinx.org>
Date: Mon, 10 Jun 2013 18:55:36 -0700
From: Linda Walsh <cygwin@tlinx.org>
User-Agent: Thunderbird
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Using 'test' fails when referencing home '~' from bash loop
References: <CAAXzdLWRMMUN=ati=6Z75CnEwTxy2VvmAON_DZwtQimJPFSroQ@mail.gmail.com>
In-Reply-To: <CAAXzdLWRMMUN=ati=6Z75CnEwTxy2VvmAON_DZwtQimJPFSroQ@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Steven Penny wrote:
> From: "Matt D."
>> The following never exits the loop:
>> until test -f "~/file.txt"; do sleep 1 && echo sleep; done; echo done
> 
> This is not an error, or even Cygwin related. With Bash you must now quote "~"
> if you want it to expand.
> 
> Do this 
>   [ -f ~/file.txt ]
> or this
>   [ -f ~'/file.txt' ]
> or this
>   [ -f "$HOME/file.txt" ]
---
She can use the format she is using ... just need to stress _not_ to use
the quotes...

the quotes don't let "~" expansion take place.

so:
      until test -f ~/file.txt ; do sleep 1 && echo sleep; done; echo done


works just fine...


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

