Command Substitution: Can you return data instead of exit codes in Bash? | #3 Practical Bash

preview_player
Показать описание
It seems bash only allows us to return an exit code from a function and not data like in other programming languages? So what do we instead? Can command substitution come to the rescue? In this video you'll learn how to safely pass data from one function in your script to another
Рекомендации по теме
Комментарии
Автор

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.

bernhardkern
Автор

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!

ernestogutierrez
Автор

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

soufianta
Автор

What if you had multiple echo statements within that called function?

loveanimals-
visit shbcf.ru