Guest User

Untitled

a guest
Nov 13th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. test1=`sed -i "/:@/c connection.url=jdbc:oracle:thin:@$ip:1521:$dataBase" $search`
  2. valid $test1
  3.  
  4. function valid () {
  5. if $test -eq 1; then
  6. echo "OK"
  7. else echo "ERROR"
  8. fi
  9. }
  10.  
  11. some_command
  12. if [ $? -eq 0 ]; then
  13. echo OK
  14. else
  15. echo FAIL
  16. fi
  17.  
  18. some_command
  19. retval=$?
  20. do_something $retval
  21. if [ $retval -ne 0 ]; then
  22. echo "Return code was not zero but $retval"
  23. fi
  24.  
  25. if some_command; then
  26. printf 'some_command succeededn'
  27. else
  28. printf 'some_command failedn'
  29. fi
  30.  
  31. if output=$(some_command); then
  32. printf 'some_command succeded, the output was «%s»n' "$output"
  33. fi
  34.  
  35. command && echo OK || echo Failed
  36.  
  37. cd /nonexistant
  38. if [ $? -ne 0 ]
  39. then
  40. echo failed
  41. else
  42. echo success!
  43. fi
  44.  
  45. command && echo $? || echo $?
Add Comment
Please, Sign In to add comment