I am looking for a shell language, with the following criteria:
- fairly popular and alive
- is small, like putting a binary in the /bin folder
- can start programs, support pipes, file operations
- has variables, if branches, lists, for loops, basic integer arithmetic, strings
- not POSIX compatible, or resembling to bash
Google offers a handful of options, but I am interested if people actually use not bash or bash alike languages for shell scripting.
You may find inspiration in other non-Unix OSs such as MCP (Unisys still supports it), or GCOS and GECOS, still supported by Atos. One would say they are user-hostile shells, but I prefer to think they are extremely selective about their friends. I can say I never made the cut for any of them.
There's also PowerShell for all the OSes. PowerShell is object-oriented, well-dcumented, and quite different from POSIX shells: https://learn.microsoft.com/en-us/powershell/scripting/insta...
The language doesn't have native pipes, but I'll sometimes include them in a command string `const output= exec("firstcommand ${somevariable} | secondcommand")`
As an added bonus you have access to the npm ecosystem.
If you are using large amounts of ifs and fors or doing anything but basic arithmetic, you are probably not using bash idiomatically resulting in the feeling of hammering a screw. It's not that the hammer is a bad tool, so much as it is wrong tool for the task. The bash idiom for writing a complex shell script is write a python program and call it.
Almost all infra devs in the valley will use bash, zsh, or fish and then write a python program once a task is mildly complex.
> not POSIX compatible
What do you mean when you say this?
Bash is worth understanding, you can do extremely complex things with pretty minimal effort. It's generally less verbose and therefore quicker and easier to read. It generally discourages complexity. There are many default behaviors that make many tasks easier and less boiler-plate-y. Autocomplete in shell is very efficient and doesn't require the overhead of an IDE. If for no other reason, you should spend a day or 2 learning bash because if you do any serious level of administration you will definitely run into bash shell scripts and it's worth knowing the pitfalls of bash if you need to fix/edit them. Sometimes git repos will have shell scripts for various purposes embedded in them as well.
xargs is one of the most beautiful programs I've ever used. It is probably the most low effort parallelism that exists in software.
With bash, it's relatively simple to ssh into a list of machines, then grep through all of their log files for a hash (maybe a request id or a specific IP). You could even ssh and then sum the number of 500's and then sum the number of 500's from each of the individual machines.
You can do impromptu map-reduce style operations with extreme efficiency on arbitrary data sources.
If I were interviewing a person and they didn't know bash or thought it was a bad tool I would take that as a major red flag. I have even been asked bash adjacent questions (questions that require understanding, not programming) in interviews from bigtechcos.
BTW, there are books like programming ruby and more interestingly meta-programming in ruby that make "[ for if-branches" look like child's play. Many domain specific languages do all types of crazy stuff.