Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. errormsg=$(sample.sh 2>&1)
  2. if [ $? -ne 0 ]
  3. then
  4. echo $?
  5. echo "Successful."
  6. else
  7. echo $?
  8. echo "Error."
  9.  
  10. 0
  11. Successful
  12.  
  13. errormsg=$(sample.sh 2>&1)
  14. echo $?
  15. if [ $? -ne 0 ]
  16. then
  17. echo $?
  18. echo "Successful."
  19. else
  20. echo $?
  21. echo "Error."
  22.  
  23. 1
  24. 1
  25. Error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement