Helpful functions and scripts to aid in scripting and development
Find a file
2023-10-31 21:41:51 -05:00
scripts make-lsp: Fix quoting on -C and -f, JSON dir fix 2023-10-09 03:02:49 -05:00
t dynamic_main: Fix array size check, write test case 2023-10-31 21:41:51 -05:00
.gitignore [NEW] Makefile: Allow system-wide installation of helpers and scripts 2023-10-16 22:00:19 -05:00
dynamic_main.bash dynamic_main: Fix array size check, write test case 2023-10-31 21:41:51 -05:00
env.bash [NEW] env.bash: new add_path helper 2023-10-16 22:08:26 -05:00
errhandl.bash Added unhappy_ending to happy wrappy 2023-05-04 14:38:30 -05:00
errno.bash Added errno.bash :) 2023-05-15 14:33:38 -05:00
LICENSE added LICENSE and README 2023-02-22 13:06:18 -06:00
logging.bash logging: $usage helper and more cat-like helpers 2023-10-09 02:32:58 -05:00
Makefile [NEW] Makefile: Allow system-wide installation of helpers and scripts 2023-10-16 22:00:19 -05:00
README.md README: Fix formatting 2023-10-16 22:02:35 -05:00
text.bash [NEW] text.bash: very primitive sed escaper (patches welcome) 2023-10-16 22:09:11 -05:00

Bash Helpers

Arcane incantations that we're tired of remembering how to do in Bash will end up here. Include me as a submodule in whenever you're writing shell scripts.

Patches welcome!

Installing

Simply install with make!

# make install

If you'd like to install it to a different PREFIX simply specify one on the make command-line (or in your environment):

$ PREFIX="$HOME/.local" make install

Using in your scripts!

You can use the bash helpers in two ways:

  1. As a Git submodule
  2. From Bash's $PATH environment variable.

As a Git submodule

$ git submodule add https://github.com/targetdisk/bash-util.git

From your scripts you can now source the .bash files relative to the bash-util directory in your tree.

From Bash's PATH

If you followed along with the Installing section you should have installed the helpers somewhere in your environment's $PATH. If so, you should now be able to write scripts like:

#!/usr/bin/env bash

. logging.bash

die "I am dead now!"

echo "I never execute!"

Or even run this in your Bash shell:

$ . env.bash && add_path "$HOME/.local/bin"