4 ms·
Cool idea. Wish it supported Bash 3 (did read the note on that). For some strange reason, sourcing Lib/Array/Intersect.sh is an infinite loop. The full library,
by thesmallestcat 10y ago
Cool idea. Wish it supported Bash 3 (did read the note on that). For some strange reason, sourcing Lib/Array/Intersect.sh is an infinite loop. The full library, apart from that file, sources in a few seconds which isn't terrible:
$ time { . lib/oo-bootstrap.sh ; for f in `find lib/ -type f -name '*.sh' -not -name oo-bootstrap.sh` ; do echo $f && source $f ; done ; }
lib/Array/Contains.sh
lib/Array/List.sh
lib/Array/Reverse.sh
lib/String/GetSpaces.sh
lib/String/IsNumber.sh
lib/String/SanitizeForVariable.sh
lib/String/SlashReplacement.sh
lib/String/UUID.sh
lib/TypePrimitives/array.sh
lib/TypePrimitives/boolean.sh
lib/TypePrimitives/integer.sh
lib/TypePrimitives/map.sh
lib/TypePrimitives/string.sh
lib/UI/Color.sh
lib/UI/Console.sh
lib/UI/Cursor.sh
lib/util/bash4.sh
lib/util/class.sh
lib/util/command.sh
lib/util/exception.sh
lib/util/log.sh
lib/util/namedParameters.sh
lib/util/pipe.sh
lib/util/test.sh
lib/util/tryCatch.sh
lib/util/type.sh
lib/util/variable.sh
real 0m2.490s
user 0m1.240s
sys 0m0.834s
Sadly it broke my already installed bash completion:
$ ls # + <TAB>
x UNCAUGHT EXCEPTION: quoted
gsed: -e expression #1, char 2: invalid usage of line address 0
|} [bash_completion:0]
|} * _filedir [bash_completion:1196]
|} x COMPREPLY=( $( compgen -P "$prefix" -W "${COMPREPLY[@]}" ) ) [bash_completion:1196]
! Press [CTRL+C] to exit or [Return] to continue execution.
I don't understand why somebody would use Bash in this way though, maybe just for fun?
- npongratz 10y agoI think it is unlikely somebody would use Bash Infinity interactively, since it's apparently targeting scripting: "The aim of Bash Infinity is to maximize readability of bash scripts, minimize the amount of code repeat and create a central repository for well-written, and a well-tested standard library for bash."
- thesmallestcat 10y agoThat's fair, though there is also a class of Bash scripts that are invoked by sourcing.
- kbenson 10y agoIt is odd. It's not like you can assume bash is everywhere, it's not installed by default on some BSDs (unless this is really an sh standard lib, not bash). You're probably better off going with Perl, it probably exists on the system you are targeting (and it's quite heavy, but it you want to you can package it into an executable for Windows if you need).
- nickpsecurity 10y agoDo you know if anyone has done a survey of what software is on almost all the BSD or Linux boxes for deployment purposes? Especially, transpiling unsupported X to supported Y.
- kbenson 10y agoNo, but that would be wonderful! A caniuse.com for operating systems, listing whether a major for of software (library, interpreter, compiler, shell) is available as part of the default install, part of additional packages from the core set during install, from additional packages blessed by the provider but not available through install media, a third party repo, source compilation, or is known to not be functional.
- nickpsecurity 10y agoThat's pretty nice link. Thanks for it. Yeah, that but for basic software.
- jorge-fundido 10y agoI see bash as a lowest common denominator for ops & sys admins. There would be too much friction getting the pack to agree on python, perl, ruby, etc., especially since most of the code would be shell'ing out commands to /bin/sh or /bin/bash anyway. Bash does leave a lot to be desired when it comes to data structures and error handling, but in some cases it makes the most sense. In those cases, better to have some semblance of sanity via a common lib like bash-infinity or bash-booster.
- jorge-fundido 10y agoAlthough after looking at it some more, it bears little semblance to bash - kills my "common denominator" argument. I prefer a more bash-booster approach: bash plus common functions to standardize on.