Skip to content

Kamilcuk/L_lib

Repository files navigation

L_lib.sh

my labrador dog

Labrador Bash library. Collection of functions and libraries that I deem useful for working with Bash.

Kindly feel free to have converstations and ask questions on Github discussion and report bugs using Github issue.

Check https://kamilcuk.github.io/L_lib/ for the generated documentation.

Installation

The library is one file. Download the latest release from github and put in your PATH:

mkdir -vp ~/.local/bin/
curl -o ~/.local/bin/L_lib.sh https://raw.githubusercontent.com/Kamilcuk/L_lib/refs/heads/v0/bin/L_lib.sh
export PATH=~/.local/bin:$PATH

You can use the library with:

. L_lib.sh

You can test the library without installing with:

( . <(curl https://raw.githubusercontent.com/Kamilcuk/L_lib/refs/heads/v0/bin/L_lib.sh) && L_argparse -- -v -- arg ---- -v world hello && echo "$arg" "$v" )

Features

Below is some list with some of the library features. The library contains much more.

Conventions

  • L_* prefix for public symbols.
  • _L_* prefix for private symbols, including local variables in functions taking a namereference.
  • Upper case used for global scope readonly variables.
  • Lower case used for functions and user mutable variables
  • Snake case for everything.
  • The option -v <var> is used to store the result in a variable instead of printing it.
    • This follows the convention of printf -v <var>.
    • Without the -v option, the function outputs the elements on lines to stdout.
    • Associated function with _v suffix store the result in a hardcoded scratch variable L_v.

License

LGPL

About

Bash library for day to day tasks and scripting

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors 2

  •  
  •  

Languages