?
Solved

Errorlevel - how to find it?

Posted on 1997-06-24
1
Medium Priority
?
323 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

801 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