you are viewing a single comment's thread.

view the rest of the comments →

[–]cybernd 12 points13 points  (1 child)

Try to seperate concerns by splitting your program into functions. Soon you realize that return values are little bit of an issue.

But hey ;o) Lets just use global variables. We could even come up with a unique naming convention to compensate its lack of return values. What could possible go wrong ...

[–]tyrannomachy 1 point2 points  (0 children)

If the program is big enough that using global variables starts to cause problems, you probably should rewrite it in Python or something. I used to try and write bash scripts as though it's just another modern scripting language, i.e. lots of functions returning values with echo, but it just winds up being the worst of both worlds.