Libraries and utilities to make Bash and the command line more efficient.
Shared bash function libraries are in ./share
:
stdlib.sh
: useful shared functions including error reporting, type checks, file state checks, and string matching
Useful command line utilities are in ./bin
:
dateseq
:seq
, but for dates, including filtering by weekdaydayspast
: prints the number of days since the given date, useful withfind
getip
: prints IP for a given DNS namegetname
: prints DNS name for a given IPipsort
: sorts IPv4 addresses numerically by octetssubsize
: prints the cumulative file size of each subdirectory of PWD or the specified directoriesuc
: prints a sorted list of the frequency of unique lines in stdin or a file or set of filesyesterday
: prints yesterday's date, or the day before the provided date
This command will install the utilities in ./bin
to /usr/local/bin
and the support libraries in ./share
to /usr/share/bashutils
:
$ sudo make install
To use stdlib.sh
in your Bash scripts, include the following line:
source /usr/share/bashutils/stdlib.sh ||exit
To run the included tests:
$ make test
David Adams, daveadams@gmail.com
The software in this repository is public domain.