Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> * 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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: