Had I known function return statements where meant for returning exit codes (0-255) back when I started coding bash scripts, I would have saved myself a lot of troubleshooting time :S Great video mate!
All output that is usually sent to stdout would be caught. A single or multiple echo statements don't make a difference. We only see an echo statement as a "unit" because it automatically appends a new line ( ) at the end of the line. However, that's just a default setting and you can in fact not add a new line by using "echo -n foo". Similarly the new line would just be caught by the command substitution along with the remaining output.
Hi, this is one of the weird things I took time to understand. Actually, bash shouldn’t be compared to other languages (data types). Bash was supposed to run external binaries/commands that do their stuff and binaries don’t need to play with return values of other binaires. Nice video btw
yay, my first youtube comment, just to tell you that your video series is great. Watched the https/tls video and landed in your bash series.
Thanks! I feel honored to receive your first ever youtube comment :-)
Had I known function return statements where meant for returning exit codes (0-255) back when I started coding bash scripts, I would have saved myself a lot of troubleshooting time :S
Great video mate!
This series is awesome. Thanks !
Love the series. Thanks!!
Introduced me to shellcheck, thanks!
And you just gave me the idea to create a video about shellcheck. Thanks :)
@@kubucation :)
What if you had multiple echo statements within that called function?
All output that is usually sent to stdout would be caught. A single or multiple echo statements don't make a difference. We only see an echo statement as a "unit" because it automatically appends a new line (
) at the end of the line. However, that's just a default setting and you can in fact not add a new line by using "echo -n foo". Similarly the new line would just be caught by the command substitution along with the remaining output.
Hi, this is one of the weird things I took time to understand. Actually, bash shouldn’t be compared to other languages (data types). Bash was supposed to run external binaries/commands that do their stuff and binaries don’t need to play with return values of other binaires. Nice video btw
thanks, very understandable
thanks a lot, very glad to hear :)
part 3?