SCOUG Logo


Next Meeting: Sat, TBD
Meeting Directions


Be a Member
Join SCOUG

Navigation:


Help with Searching

20 Most Recent Documents
Search Archives
Index by date, title, author, category.


Features:

Mr. Know-It-All
Ink
Download!










SCOUG:

Home

Email Lists

SIGs (Internet, General Interest, Programming, Network, more..)

Online Chats

Business

Past Presentations

Credits

Submissions

Contact SCOUG

Copyright SCOUG



warp expowest
Pictures from Sept. 1999

The views expressed in articles on this site are those of their authors.

warptech
SCOUG was there!


Copyright 1998-2024, Southern California OS/2 User Group. ALL RIGHTS RESERVED.

SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group. OS/2, Workplace Shell, and IBM are registered trademarks of International Business Machines Corporation. All other trademarks remain the property of their respective owners.

The Southern California OS/2 User Group
USA

SCOUG-HELP Mailing List Archives

Return to [ 26 | May | 2001 ]

>> Next Message >>


Date: Sat, 26 May 2001 00:29:35 PDT
From: Peter Skye <pskye@peterskye.com >
Reply-To: scoug-help@scoug.com
To: scoug-help@scoug.com
Subject: SCOUG-Help: errorlevel when piping ?

Content Type: text/plain

=====================================================
If you are responding to someone asking for help who
may not be a member of this list, be sure to use the
REPLY TO ALL feature of your email program.
=====================================================

When executing more than one program in a pipe, which program returns
the errorlevel?

Specifically, I want to XCOPY some data and TEE the list of xcopy'd
files to a log file and to the screen. I also want to check the
errorlevel returned by XCOPY to find out if XCOPY was successful. (I
can't create the log file and then type it to the screen when XCOPY is
finished because the screen display must be shown while XCOPY is
running.)

XCOPY returns an errorlevel (1,2,3,4 - see HELP XCOPY) if it fails. My
code is similar to:

cd h:
xcopy h:\* /h/o/t/s/e/r/v | tee g:\H-Xcopy.log
if errorlevel 1 echo XCOPY ERROR

My question is:
- will the above code pass the XCOPY "errorlevel" to the "if
errorlevel ..." statement, or
- will the "errorlevel" from TEE instead be passed to the "if
errorlevel ..." statement?

I can't find documentation on this. I can think of three ways the .cmd
file might be executed: 1) pass the errorlevel of the first program in
the pipe, or 2) pass the errorlevel of the last program in the pipe, or
3) pass the highest errorlevel returned by any of the programs in the
pipe.

Anybody have any info on this? Similarly, anybody know what
"errorlevel" is returned to a subsequent "if errorlevel ..." statement
when using &, && and || unconditional/conditional command processing?

- Peter

=====================================================

To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-help".

For problems, contact the list owner at
"rollin@scoug.com".

=====================================================


>> Next Message >>

Return to [ 26 | May | 2001 ]



The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA

Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS RESERVED.

SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group. OS/2, Workplace Shell, and IBM are registered trademarks of International Business Machines Corporation. All other trademarks remain the property of their respective owners.