X-Spam-Check-By: sourceware.org Message-ID: Date: Sun, 6 Aug 2006 17:47:15 +0100 From: "Mark Fisher" To: cygwin AT cygwin DOT com Subject: Re: Checking XCOPY Exit Value in Cygwin Bash In-Reply-To: <74382BAFEAA.000000D2wolfpack@inbox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <74382BAFEAA DOT 000000D2wolfpack AT inbox DOT com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: 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 On 8/6/06, Shane wrote: > Can you please provide me a way of checking the XCOPY exit code: reference [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true] within Bash? result codes are stored in $? in bash success = 0 usually, and xcopy seems to follow the norm here. here, i did xcopy somefile somedir echo $? which returned 0 when i tried xcopy nonfile somedir echo $? i get 4 so test for 0 for success. extensions of this idea: xcopy somefile somedir && echo ok xcopy somefile somedir || echo fail -- 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/