X-Spam-Check-By: sourceware.org Message-ID: <44D623D7.9090207@inbox.com> Date: Mon, 07 Aug 2006 02:16:07 +0900 From: Shane 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> In-Reply-To: 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 AT cygwin DOT com; run by ezmlm 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 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/