Guest User

Untitled

a guest
Nov 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. seeOutput=`return`
  3. echo $seeOutput
  4.  
  5. -bash: return: can only `return' from a function or sourced script
  6.  
  7. false ; echo $?
  8. true ; echo $?
  9.  
  10. 1
  11. 0
  12.  
  13. f()
  14. {
  15. ls $AAA
  16. return $?
  17. }
  18.  
  19. g()
  20. {
  21. f
  22. return $?
  23. }
  24.  
  25. d()
  26. {
  27. g
  28. echo $?
  29. }
  30.  
  31. AAA=
  32. d
  33.  
  34. <contents of dir>
  35. 0
  36.  
  37. AAA=sdsasdasd
  38. d
  39.  
  40. ls: sdsasdasd: No such file or directory
  41. 2
Add Comment
Please, Sign In to add comment