delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/08/06/13:16:23

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

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/

- Raw text -


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