Perl (5). It's an incredibly capable scripting language, many things essential for Shell programming are much better integrated than in Python (e.g. regular expressions). It gets a lot of hate these days but it's still a damn fine language and perfectly suited to shell programming (and larger projects).
One of the things about Perl is that I can't quite believe myself how far it has fallen. I was never a Perl monk by any means but I knew enough to get by. And why did I not even think about it? I haven't coded Perl in years, but if my memory serves me correctly, bundling extra dependencies in Perl was a heck of a lot less painful than Python too.
Ask HN: What to use instead of Bash / Sh for scripting?
61–70 of 106 posts
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#62Re: Ask HN: What to use instead of Bash / Sh for scripting?
#63Have you tried other shells like csh or tcsh?
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#64Re: Ask HN: What to use instead of Bash / Sh for scripting?
#65Earlier quoted context omitted.
I just checked, if you already have .NET installed, the powershell package is about 20 MBs, which is… tolerable. However, I see that the latest version still starts very slowly compared to *nix shells (and also Python). The shell was running from tmpfs (so basically a RAM disk). I have a decent processor and an NVMe SSD, and this is what I see (it was tested 10 times in a row to pull everything into the page cache pr…
How about pwsh -NoLogo -NoProfile ? > Measure-Command { pwsh -NoProfile -NoLogo exit } Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 254 BTW, Windows OS is often subject of Windows Defender and other AVs which are not present on Linux machines and their slowdown of the system is phenomenal.
$ time ./pwsh -NoProfile -NoLogo /dev/null
real 0m0.456s
user 0m0.388s
sys 0m0.040s
Much better, but I still wouldn't use this even as an interactive shell, as I open a few hundred terminal windows each day.There's no defender (or anything similar) on that other machine. It also has an SSD. With an older HDD powershell started in about 10-15 seconds there (while cold startup time for bash was something like a second, and instantly afterwards).
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#66Its Perl-ish roots just make it a fantastic tool for the job.
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#67When binary size and startup speed matters, then I use Go instead.
Finally, sometimes I just write in Bash anyway, even though it is such a difficult language to write in.
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#68Re: Ask HN: What to use instead of Bash / Sh for scripting?
#69Re: Ask HN: What to use instead of Bash / Sh for scripting?
#70Earlier quoted context omitted.
Powershell is a horror you mean, it's got the verbosity of objective c with the consistency that comes with all Microsoft designed products. Just use a proper scripting language.
No, I said what I mean. Bash and its disasters like [ as executable and mega error prone and awkward language designed 50 years ago IS horror. Verbosity of powershell is optional, I don't use it. > consistency that comes with all Microsoft designed products. Oh, lets not troll here.