Bashin is an extension of BASH intended to be as minimal and clean as possible; Wrote in pure BASH, bashin is super fast
Many scripters resort to slow external commands glued together with pipes and subshells. Of course they have their use cases but generally (for performance sake) they should be avoided
Bashin supports push, pop, cycling arrays and many more array/stack operations. Bashin handles ANSI escape sequences that make coloring, positioning and other terminal modifications much more simple (like building a TUI)
push 'a' 'b' 'c'
echo "${STACK[@}"
a b c
stack -r
echo "${STACK[@]}"
c b a
arr=('a' 'b' 'c')
reverse_array "${arr[@]}"
echo "${REVERSE[@]}"
c b a
arr1=('a' 'b' 'c') arr2=('a' 'c')
unique "${arr1[*]}" "${arr2[*]}"
echo "${UNIQUE[@]}"
b
— Among many other things; Bashin can be sourced interactively or per script
execute the setup.sh script (recommended)
bash <(curl -s https://raw.githubusercontent.com/wick3dr0se/bashin/main/setup.sh)
the one-liner above will remotely execute the bashin
setup script - including bashin
clone the repository
git clone https://github.com/wick3dr0se/bashin&& cd "${_##*/}"
execute the setup.sh script bash setup.sh
otherwise source bashin within another script:
<path>/bashin
# or
. <path>/bashin
source within your ~/.bashrc to use interactively & globally
then use import_all
or import
to manually source necessary procs (functions), e.g. import ansi
core libs (scripts) are implicitly imported
See usage.sh
for examples and view documentation in the respective library directory