This gets me everytime -- and I wrote the darn thing!
Pipes are powerful but you have to communicate some output value through the pipe's stdout and process it yourself in order to pass through the fact that stream signals a return. Then you have to cal return or exit when you see that signal -- obviously.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nope. it doesn't. neither does exit. GNU Bash does the same thing. See http://unix.stackexchange.com/questions/230654/is-this-a-bug-in-bash-return-doesnt-quit-function-if-called-from-a-pipe/230682
This gets me everytime -- and I wrote the darn thing!
Pipes are powerful but you have to communicate some output value through the pipe's stdout and process it yourself in order to pass through the fact that stream signals a return. Then you have to cal return or exit when you see that signal -- obviously.