pure-bash-bible
pure-bash-bible copied to clipboard
📖 A collection of pure bash alternatives to external processes.
Bash
TODO
- [x] Dynamic variable naming. - [x] Internal variables. - [x] Turn the non-functions into functions. - This is so tests can be written. - It also shows a working...
https://github.com/dylanaraps/pure-bash-bible#reverse-an-array This approach is not restricted to >= 5.0, which will probably be a huge deal to some people looking to write more portably. It works in >= 3.1. Tested...
Spent a crazy long time debugging a gitlab script where I tried to assign "exit-code=$?" and had no idea why bash wasn't accepting it. A buddy sent me this repo...
https://github.com/dylanaraps/pure-bash-bible#split-a-string-on-a-delimiter This function works as intended in >= 3.1, unless I'm forgetting something. Prior to 3.1, you'll likely incorrectly see single-quotes in the output, if it even gets that far....
Hi, first big thanks for the "bible". I think it might helpful to add more file handling tips like "get filepath from first file in a directory" or "get the...
``` dos2unix() { # Usage: dos2unix [FILE] if (($#)); then dos2unix < "${1}"; return 0 fi local now on none while read -rN1 now; do case "${now}" in $'\r') on=1...
I believe the `cycle` function can be simplified when there are only two elements to toggle between: ```sh arr=(true false) toggle() { printf '%s ' "${arr[${i:=0}]}" ((i=1-i)) # ((i=i^1)) also...
So, first off this seems like a really awesome project :slightly_smiling_face: I love me some bash :grin:. So, thank you for making this. One of my friends linked to it...