Hacker News new | ask | show | jobs
by IshKebab 3274 days ago
Or the author justifiably thinks that a shell shouldn't support functions?
1 comments

Why shouldn't it? The shell is arguably the most convenient way to interact with your system's programs, seconded only by something like Perl. That level of interaction ought to mean you can write functions such as for common tasks. Or should I now have to use Perl for that?
Because fragile shell scripts have been an endless source of security vulnerabilities and bugs.

I would probably use Python, Go or Powershell.

You can use functions outside of shell scripts - they can serve as a better kind of alias, or as a way of modifying the current shell without having to type the '.' before the script.
Shells languages arguably should be usable programming languages. So start with a good, expressive one add add scripting as a library:

http://users.eecs.northwestern.edu/~jesse/pubs/caml-shcaml/

Incidentally, that would also dramatically decreased security and maintainability problems.