bash-core
oh
Our great sponsors
bash-core | oh | |
---|---|---|
2 | 6 | |
3 | 1,344 | |
- | - | |
3.2 | 4.3 | |
7 months ago | 7 months ago | |
Shell | Go | |
Mozilla Public License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
bash-core
-
I'd like your opinion on my choice of Bash for data manipulation/cleaning and some stats
Error handling is also atrocious. Doing set -e fixes some issues, but there are plenty of valid cases in which one of your commands will have an error, and your script will continue execution like nothing ever happened. And, in the case of an error, as I'm sure you have realized, diagnostics are absolutely terrible. You're extremely lucky to get a line number (which I think was only added since Bash 5.1), but that's it. If you want anything more, like a stacktrace, you're stuck in the water. I have developed a library, bash-core, to help with this, but the stacktrace handling acts unexpectedly if there are errors within subshells.
-
Bash functions are better than I thought
I'm quite happy to see that something Bash-related is on Hacker News! Unfortunately it seems that I don't really agree with much the author...
While I do agree that it would be nice to be able to have 'local' functions and have inter-function cleanup work better, the logical conclusion for me was not to use function subshells. Since the use case is for larger programs (where different functions may want to have their own cleanup mechanisms), I'm opting to go for more of a library route. For example, I'm working on a Bash library that includes a function to allow different sources to add (and remove) functions to the same `TRAP`. A similar function may be useful, possibly involving the `RETURN` trap and the `-T` flag. Obviously, using a package manager for _Bash_ of all languages brings in a lot of overhead, but I think it can be quite powerful, especially with a potential "Bundle" feature that makes scripts work without the package manager.
Concerning specifically the use of subshells, (as other commenters have pointed out) it significantly reduces performance. I also disagree that dynamic scoping is necessarily bad for Bash. I find it quite useful when I need to use various common functions to manipulate a variable - since modifying and 'returning' variables from a function is usually either slow or verbose with Bash. Admittedly though, this feature is quite annoying at times - for example, most public functions in my Bash package manager[2] all have their variables prefixed with two underscores - because they `source` all the shell scripts of all package dependencies - so I want to be extra certain nothing weird happens
[1] https://github.com/hyperupcall/bash-core/blob/a17ab0a8b6070f...
oh
- Understanding the Power of Lisp (2020)
- Bass – Lisp dialect for scripting the infrastructure beneath your project
-
CommandConsole: A shell written in C
I think an extensible shell like oh shell would be something I would prefer. Though it should not need closures on heap to extend (which is ridolous slow on arithmetic) and generate the data types at compilation time.
-
Bash functions are better than I thought
> Is there a reason we aren’t using a shell with a proper programming language for scripting?
Mostly because the people who want to introduce a "programming language" into the shell don't prioritize being a shell.
Check out the "Oh" shell for contrast. This is what a programming language looks like when you force it to conform to being a shell first priority.
https://github.com/michaelmacinnis/oh
https://www.youtube.com/watch?v=v1m-WEZz46U
This is "Scheme-like" but has FEXPRs so things can be redefined and evaluation can be controlled.
-
Show HN: SectorLISP Now Fits in One Sector
I love chatting about Kernel :D Here's my most recent post: https://lobste.rs/s/d0hogq/problem_with_macros#c_nozcrm
Thanks for showing me Oh! It really has f-exprs?! I didn't immediately see it in https://github.com/michaelmacinnis/oh/blob/main/doc/manual.m...
- Oh, a New Unix Shell
What are some alternatives?
nsd - NGS Scripts Dumpster
elvish - Powerful scripting language & Versatile interactive shell
bash-object - Manipulate heterogenous data hierarchies in Bash.
sicp - HTML5/EPUB3 version of SICP
hasura-ci-cd-action
cl-unix-cybernetics - UNIX system administration in Common Lisp
bash2048 - 2048 in bash
lsofer - script to match similar functionality to lsof -i, and then some.
basalt - The rock-solid Bash package manager.
PPSS - Parallel Processing Shell Script