Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. foocommand && foocommand2 && foocommand3
  2.  
  3. #!/bin/sh
  4. ls -lh &&
  5. # This is a comment
  6. echo 'Wicked, it works!'
  7.  
  8. #!/bin/bash -e
  9.  
  10. foocommand || exit 1
  11. foocommand2 || exit 2
  12. foocommand3 || exit 3
  13.  
  14. if foocommand; then
  15.  
  16. # some comments
  17.  
  18. if foocommand2; then
  19.  
  20. # more comments
  21.  
  22. foocommand3
  23. fi
  24. fi
  25.  
  26. foocommand &&
  27. # some comment
  28. foocommand2 &&
  29. # more comment
  30. foocommand3
  31.  
  32. { { false && echo "inner true"; } && { echo "inner true" && true; } || { echo "inner false" && false; } || echo "outter false"; }
  33.  
  34. big_block_1() {
  35. # ...
  36. }
  37. big_block_2() {
  38. # ...
  39. }
  40. big_block_3() {
  41. # ...
  42. }
  43.  
  44. big_block_1 && big_block_2 && big_block_3
  45.  
  46. function fail() {
  47. echo "Failure: ${@}"
  48. exit 1
  49. }
  50.  
  51. foocommand || fail "couldn't foo"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement