Git Product home page Git Product logo

bashmultitool's Introduction

Donate

Overview

  • Name: bashMultiTool
  • Description:

A Bash Shell library file for commonly used functions can be imported into shell scripts to create functional and colorful scripts and Terminal users interfaces(TUI). The library allows user to redefine commonly used functions every time you write a shell script, the library may save a part of the development time.

  • Author: Gavin Lyons
  • GNU bash: version 5.1.16

Table of contents

Installation

Linux debian based systems built on Ubuntu 22.04 LTS (Jammy Jellyfish)

A Personal Package Archives (PPA) has been created on Ubuntu package building and hosting section of launchpad site called bashmultitool.

To install this on your system run commands in terminal

sudo add-apt-repository ppa:typematrix/bashmultitool
sudo apt update
sudo apt install bashmultitool

Arch based System

Package available in the Arch Linux user repo AUR

For other linux systems

Download latest fixed release and run the makefile as per terminal commands below for version 2.1 latest release at time of writing Note: If you install with this method you will not be informed of updates by system.

curl -sL https://github.com/gavinlyonsrepo/bashmultitool/archive/2.1.tar.gz | tar xz
cd  bashmultitool-2.1
sudo make install

Usage

Source the library functions from your bash shell scripts like so:

LIBPATH="/usr/lib/bashmultitool/"
for MYFILE in "$LIBPATH"*;
do
	source "$MYFILE"
done

To access library functions from your shell scripts type:

# [function-name] [keyword] [options]
# eg

bmtPrintFunc b_red "Hello World"

Software

Eight separate markdown help files with detailed information, in documentation folder are available. For shortcut to each help file click on link in 2nd table below. A script to print library meta data is also installed.

Installed File Path Description
/usr/bin/bashmultitool Script to print library meta data
/usr/lib/bashmultitool/bashmultitool/* 8 library files see next table
/usr/lib/bashmultitool/doc/README.md readme
/usr/lib/bashmultitool/doc/bmt*.md 8 Documentation files see next table
Library file Function Sections Content Doc link
bmtPrint bmtPrintFunc 101 Printing text bmtPrint help file
bmtPrompt bmtPromptFunc 201-210 Prompts bmtPrompt help file
bmtNetwork bmtNetworkFunc 301-302 Network related bmtNetwork help file
bmtLinux bmtLinuxFunc 401-408 Linux related bmtLinux help file
bmtFiles bmtFilesFunc 501-510 File related bmtFiles help file
bmtData btmDataFunc 601-607 Data related bmtData help file
bmtTime btmTimeFunc 701-710 Time related bmtTime help file
bmtMisc bmtMiscFunc 801-806 Miscellaneous bmtMisc help file
bmtTest bmtTestFunc 901 internal library test bmtTest help file

The library contains eight section's, Each section has one file with one function. Which contains 54 sub-sections in total. The sections are grouped per logical function. Printing, prompting, Linux related, file related, data related, time related , network related and miscellaneous. The sections are mostly independent of each other you can source them individually if you wish, however the prompt file is dependent on print. There is also a ninth test section bmtTest used to test library.

The repo also contains a test folder where a test file used in development are available, one function for each library file. The test file "testTest.sh", runs an semi-automated test on entire library and produces a report. Pass the test file a number between 1-9 , 1-8 correspond to the sections, 9 will test entire library.

Example

Output of basic example file in example folder, showing basic usage.

ScreenShot

Output report of test script testTest.sh.

ScreenShot

bashmultitool's People

Contributors

gavinlyonsrepo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bashmultitool's Issues

hey quick question/ possible error

hey in misc functions

	if [ -n __BMT_START_WATCH ] 
		then
			local stopWatchVar=0
			stopWatchVar=$(bmtMiscFunc now)
			bmtMiscFunc elapsed "$__BMT_START_WATCH" "$stopWatchVar" 
			return 0
		else
			return 2
		fi
	;;

under stopwatch #6 shouldnt it be

if [[ -n "$__BMTSTART_WATCH" ]];
     then

i could be wrong I'm fairly new to programming.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.