X-Spam-Check-By: sourceware.org
Message-ID: <44D623D7.9090207@inbox.com>
Date: Mon, 07 Aug 2006 02:16:07 +0900
From: Shane <wolfpack@inbox.com>
User-Agent: Thunderbird 1.5.0.5 (Windows/20060719)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Checking XCOPY Exit Value in Cygwin Bash
References: <74382BAFEAA.000000D2wolfpack@inbox.com> <Pine.GSO.4.63.0608061222390.3283@access1.cims.nyu.edu>
In-Reply-To: <Pine.GSO.4.63.0608061222390.3283@access1.cims.nyu.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IWM-ACU: KHYcJ46lPVU5D6nxlx4rPegFoOUzDsZKTxd2wUc_72N459DPbgVQF2IKpvmw   Oi-WbkAyv0XajsJJYt2RdqWC_MQxY924fnSy5SGu8LuwyhTBL1XGELB61QcC vzw@@
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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

Igor Peshansky wrote:
> Nope, you didn't have to.  Something like
>
> (cd "$2/.." && find "$2" -name "*.$1" | tar cfT - -) | tar xfC - "$3"
>
> would do the job of "XCOPY /S" using POSIX means.
>
>   
> If you go POSIX, you can use the --keep-newer-files tar option.
>
>   
> Of course it didn't.  Please read a good bash tutorial, or the "Special
> Parameters" section of the bash manpage.
>   
Hi Igor and Mark,
    Thank you very much for the quick reply.

I was initially using 

tar -cf - `find "$source_dir" -name "*.$file_ext" -print` | ( cd "$dest_dir" && tar xBf - )

but it had a problem with path names with spaces. Obviously being not that good in bash scripting, I couldn't get over that issue. So that was why I decided to use the XCOPY command. I will use your method and see. Thanks again.

	I made a silly mistake in my former email. I was actually checking $? (not $!) for the exit code, but it didn't work. But I saw in a later reply from Mark that it worked for him. I will check it again. Maybe I was doing something silly.

thanks again 
Regards
Shane


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

