Earlier quoted context omitted.
You may be interested in xonsh, a shell that supports both python and bash-like expressions: https://xon.sh/
is this like fish?
Bash 5.0 released
181–190 of 306 posts
Re: Bash 5.0 released
#182Earlier quoted context omitted.
What percent of Unices come with Powershell today? I can write my code in bash and forget about it. Or if I'm supporting less systems (most linux + macOS + most modern Unices) I can write my code in perl or python. Powershell? Thanks but no thanks.
> I can write my code in bash and forget about it. In practice, this approach often results in code that works only on Linux, or on Linux and macOS. I especially hate it when people shove #!/bin/bash as a shebang, and doubly so when it's in scripts that are a part of some npm package. (On BSDs, Bash is not installed out of the box, and when it is installed, it's not in /bin, since it's not in the base system.) Still,…
Re: Bash 5.0 released
#183Why did we keep the language of the shell and the OS separate? It seems like a needless abstraction which creates more harm than good (read a shell script vs any other language). While I'm at it, why is the filesystem and syscall api not just part of a standard userland language? For example, the filesystem could be exposed like an object tree rather than some syscall ritual. The syscalls could just be invisible, whe…
That was kind of the idea of Unix. C was just a nicer from Assembly. You might write a performance-sensitive or low-level routine in C, much like you might drop to C when writing a Python library. But the high-level language of the system was the shell. The `dc` executable wasn't just meant to be a user-facing calculator program, it was also meant to be the system's "bignum" library. That was big-picture Unix. The sy…
Re: Bash 5.0 released
#184Yet macOS is still on 3.2.
MacOS doesn't appear to ship GPLv3 licensed code. 3.2 is the last update on GPLv2. Alternatively - newer versions of ZSH are frequently provided by Apple.
Re: Bash 5.0 released
#185Any recommended reading for Bash? I'm somewhat new to it and it's interesting ways of getting things done. I've used it minimally in the past, but have found myself writing a 100> LOC script, which I can't help but feel I'm likely over-complicating certain bits and pieces.
* use traps http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_12_02.htm...
* read about safe ways to do things in bash https://github.com/anordal/shellharden/blob/master/how_to_do...
* this is pretty helpful writeup of general CLI usage, yet not bash specific https://github.com/jlevy/the-art-of-command-line (related HN discussion https://news.ycombinator.com/item?id=9720813)
Re: Bash 5.0 released
#186Earlier quoted context omitted.
Here is my favourite bash script: https://blog.ashfame.com/2018/02/deploying-lambdas-multiple-... Deploy a lambda function in multiple regions (15 regions!) with just one bash script using Apex up. Add route53 on top with Latency Based Routing enabled and you've a latency in 10s of millsecond from anywhere on the globe without paying a hefty fee for this kind of latency.
How is that in any way related to the parent comment?
Re: Bash 5.0 released
#187Re: Bash 5.0 released
#188With this release, bash now has three built-in variables (um, I mean "parameters") whose values are updated every time they're read: $RANDOM yields a random integer in the range 0..32767. (This feature was already there.) $EPOCHSECONDS yields the whole number of seconds since the epoch. $EPOCHREALTIME yields the number of seconds since the epoch with microsecond precision. I'm thinking of a new shell feature that wou…
Anyone knows why a `microsecond since epoch` is named "realtime"? What is so "guaranteed" about it?
Re: Bash 5.0 released
#189Earlier quoted context omitted.
> GNU projects tend have info pages that are a lot more complete and thorough then their man pages Why is that? Why don’t they build both from a single source?
Because they're structured differently. A man page for an app is just that, a page, with some formatting and sections. Texinfo is more like your typical website - lots of small cross-linked pages with a common index. Consequently, a man page is usually an extended take on --help, while info pages are more like product manuals. This is the theory. The practice is that GNU mandates Texinfo for its projects, and because…
Re: Bash 5.0 released
#190Earlier quoted context omitted.
I assume you can install newer versions of Bash on macOS though? (But it certainly suggests to me that macOS isn't actually the easiest out-of-the-box solution if your workflow includes anything more than web browsing.)
On macOS almost everyone uses the homebrew package manager https://brew.sh . Installing bash is harder because you have to add the filepath of the new bash binary to /etc/shells and then set that filepath as your default shell, but brew install bash echo /usr/local/bin/bash | sudo tee -a /etc/shells chsh -s /usr/local/bin/bash and if you're on macOS and still haven't heard of homebrew, you first need to install it wi…