Products > Programming

what would you use to replace Bash for scripting?

(1/15) > >>

Bash is good, but it's too error prone.

What would you use to replace it?
(excluding big elephants like Python, which I like, but it consumes too many resources)

Php ... well, it looked a good idea, after 1 year, let me say: never again!
Lua? eLua?

Looking for something I can use to replace my startup system scripts (/etc/init.d/*), as well as my system scripts (in /usr/bin/), currently all written in Bash-scripting.

Bash is for the Linux plebe, real sysadmin only uses tcsh or ksh on their BSD headless servers.  ;D

Joke aside, I remember Tcl as a small and powerful language.  :-+
For example, Tcl has become the scripting language in HDL programming toolchains (e.g. in the Xilinx Vivado IDE for FPGAs).

I've seen Lua mentioned quite often, and software devs seem to like it.  To me (as a software noob) Lua seem yet another scripting language.  Tried to learn Lua once or twice, but never got me into its spell, and abandoned it in less than an hour.  :-//  In terms of attractiveness, Lua scored very low in comparison with Python (on my scale).

What is wrong with bash?

Perl was explicitly designed to be used instead of shell scripting. It's more or a real programming language, but with convenience features to let you use it almost like shell.

Ruby is also very good at replacing shell scripting, especially once you "require 'fileutils'", and has a lot more of the shell/perl spirit than Python does. And is just simply a better language than Python.

TCL suffers from the same problems arising from being based on text replacement as shell.

I know eLua (e="e"embedded) has been used in SONY Playstation video games, embedded into the game engine.
Some text editors come with eLua built-in. Used to provide advanced (and programmable) macros facilities.

I am tempted to open a branch, replacing all the boot-scripts with Lua scripts.

You say tcl ... umm interesting too  ;D


--- Quote from: brucehoult on March 20, 2023, 12:05:29 pm ---What is wrong with bash?

--- End quote ---

functions are not actually functions
-> can override without a warning
-> no actual return value
-> the number of arguments is not checked
-> arguments data-type is not checked

the integer data type is simulated by external tools
-> compare two numbers is ugly, and too error prone


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod