?
Solved

Errorlevel - how to find it?

Posted on 1997-06-24
1
Medium Priority
?
325 Views
Last Modified: 2013-12-26
If a program exits on a errorlevel say of 1
How do you know? What program can you use to find the current errorlevel?
0
Comment
Question by:chiefarcher
1 Comment
 
LVL 1

Accepted Solution

by:
warren_dale earned 200 total points
ID: 1293717
Under the Bourne shell (at least), $? expands to the exit status of the last program. (Actually the most recent pipeline.) So we can say:
    cmp -s $ONE $TWO
    if [ $? -eq 0 ]
    then
        echo "$ONE and $TWO are identical"
    else
        echo "$ONE and $TWO are different"
    fi
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question