3 ms·
I'm fully in favor of replacing shell scripts with Python3 scripts wherever possible. In fact that's part of my job. That being said, the author of this article
by manifoldgeo 5y ago
I'm fully in favor of replacing shell scripts with Python3 scripts wherever possible. In fact that's part of my job. That being said, the author of this article is using confusing / wrong terminology to discuss bash.
This article says that, "The [bash] shell isn't a complete programming language". While I agree that bash lacks any real data types besides strings, bash is a Turing-complete programming language[1], so it's theoretically possible to write _any_ program in bash that can be written in Python. It might be a hell of a lot uglier and lack things like imports, modules, etc., but it can be done.
For example, there is an implementation of an HTTP daemon written purely in bash[2]. Once again-- terrible idea, but great execution.
[1]: https://en.wikibooks.org/wiki/Bash_Shell_Scripting#A_few_notes_on_terminology https://en.wikibooks.org/wiki/Bash_Shell_Scripting#A_few_not...
[2]: https://github.com/avleen/bashttpd https://github.com/avleen/bashttpd
edit: added newline to separate references
- rascul 5y ago> For example, there is an implementation of an HTTP daemon written purely in bash[2]. Once again-- terrible idea, but great execution. It's not pure bash, as it relies on netcat or socat plus some other external programs (ls, tree, cat, date). There does exist a pure bash httpd though. It relies on a loadable builtin (from the bash tree though not built by default). https://github.com/dzove855/Bash-web-server https://github.com/dzove855/Bash-web-server