• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

Errorlevel - how to find it?

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
chiefarcher
Asked:
chiefarcher
1 Solution
 
warren_daleCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now