3 ms·
> * Functions can only return a status number. [In Bourne shell] A function can just print to stdout, and the caller can capture it. In this way, a function ha
by rlpb 11y ago
> * Functions can only return a status number.
[In Bourne shell] A function can just print to stdout, and the caller can capture it. In this way, a function has two outputs: an exit status, and a (normally text) result.
It's unusual to go any further, but if you really wanted to you could make a function return any number of outputs by writing to different file descriptors and having the caller capture them all separately.