1
1
Overview
2
2
--------------------------------------------
3
3
* Name: bashMultiTool
4
- * Description: A Bash Shell library file for commonly used functions
4
+ * Description:
5
+
6
+ A Bash Shell library file for commonly used functions
5
7
can be imported into shell scripts to create functional and colorful
6
8
scripts and Terminal users interfaces(TUI).
9
+ 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.
10
+
7
11
* Author: Gavin Lyons
12
+ * GNU bash: version 5.1.16
8
13
9
14
Table of contents
10
15
---------------------------
11
16
12
17
* [ Installation] ( #installation )
13
- * [ Dependencies] ( #dependencies )
14
18
* [ Usage] ( #usage )
15
- * [ Files] ( #files )
16
19
* [ Software] ( #software )
17
-
20
+ * [ Demo] ( #demo )
21
+
18
22
Installation
19
23
-----------------------------------------------
20
24
21
- ** Linux debian based systems built on Ubuntu 20 .04 LTS (Focal Fossa )**
25
+ ** Linux debian based systems built on Ubuntu 22 .04 LTS (Jammy Jellyfish )**
22
26
23
27
A Personal Package Archives (PPA) has been created on Ubuntu
24
28
package building and hosting section of launchpad site
@@ -35,27 +39,22 @@ sudo apt install bashmultitool
35
39
** For other linux systems**
36
40
37
41
Download latest fixed release and run the makefile as per
38
- terminal commands below for version 1.7 latest release at time of writing
42
+ terminal commands below for version 2.0 latest release at time of writing
39
43
Note: If you install with this method you will not be informed of updates
40
44
by system.
41
45
42
46
``` sh
43
- curl -sL https://github.com/gavinlyonsrepo/bashmultitool/archive/1.7 .tar.gz | tar xz
44
- cd bashmultitool-1.7
47
+ curl -sL https://github.com/gavinlyonsrepo/bashmultitool/archive/2.0 .tar.gz | tar xz
48
+ cd bashmultitool-2.0
45
49
sudo make install
46
50
```
47
51
** Arch based System**
48
52
49
53
It's also available in the Arch Linux user repo AUR
50
54
51
- Dependencies
52
- -------------------------------------
53
- 1 . GNU bash, version 4.4.18-2
54
-
55
- 2 . The check website section requires netcat installed. [ Netcat] ( https://en.wikipedia.org/wiki/Netcat )
56
-
57
55
Usage
58
56
-------------------------------------------
57
+
59
58
Source the library from your bash shell scripts like so:
60
59
61
60
``` sh
@@ -64,100 +63,55 @@ for MYFILE in "$LIBPATH"*;
64
63
do
65
64
source " $MYFILE "
66
65
done
67
-
68
-
69
66
```
70
67
71
- There are six files in library and they are independent of each other
68
+ There are eight files in library and they are independent of each other
72
69
you can source them individually if you wish, however the prompt file * is*
73
- dependent on print.
74
-
75
- Each file has one function, To access functions from your shell scripts type:
76
-
77
-
70
+ dependent on print. Each file has one function, To access functions from your shell scripts type:
78
71
79
72
``` sh
80
- [functionname] [keyword] [options]
73
+ [function-name] [keyword] [options]
74
+
75
+ [section] [sub-section] [options]
81
76
```
82
77
83
- Six separate markdown help files with detailed information,
78
+ Software
79
+ -----------------------------------------
80
+
81
+ Eight separate markdown help files with detailed information,
84
82
in documentation folder are available.
85
- For shortcut to each file click on link in 2nd table in * Files and setup* section below.
86
- The repo also contains a test folder where test files used in development are available.
83
+ For shortcut to each help file click on link in 2nd table in * software* section below.
87
84
88
- A script to print library meta data for test and debug is also installed.
85
+ The repo also contains a * test folder* where test files used in development are available,
86
+ one for each library file.
89
87
90
- Files and setup
91
- -----------------------------------------
88
+ A script to print library meta data is also installed.
92
89
93
- | File Path | Description |
90
+ | Installed File Path | Description |
94
91
| ------ | ------ |
95
- | /usr/bin/bashmultitool.sh | Script to print library meta data |
96
- | /usr/lib/bashmultitool/bashmultitool/* | 6 library files see next table|
97
- | /usr/lib/bashmultitool/doc/README.md | help |
98
- | /usr/lib/bashmultitool/doc/documentation/license.md | copyright |
99
- | /usr/lib/bashmultitool/doc/documentation/changelog.md | history |
100
-
92
+ | /usr/bin/bashmultitool | Script to print library meta data |
93
+ | /usr/lib/bashmultitool/bashmultitool/* | 8 library files see next table|
94
+ | /usr/lib/bashmultitool/doc/README.md | readme |
95
+ | /usr/lib/bashmultitool/doc/bmt* .md | 8 Documentation files see next table |
101
96
102
97
| Library file | Function | Sections | Content | Doc link |
103
98
| ---- | ---- | ---- | ---- | ---- |
104
99
| bmtPrint | bmtPrintFunc | 101 | Printing text | [ bmtPrint help file] ( documentation/bmtPrint.md ) |
105
- | bmtPrompt | bmtPromptFunc | 201-207 | Prompts | [ bmtPrompt help file] ( documentation/bmtPrompt.md ) |
106
- | bmtMisc | bmtMiscFunc | 301-304 | Miscellaneous | [ bmtMisc help file] ( documentation/bmtMisc.md ) |
107
- | bmtLinux | bmtLinuxFunc | 401-404 | Linux related | [ bmtLinux help file] ( documentation/bmtLinux.md ) |
108
- | bmtFiles | bmtFilesFunc | 501-505 | File related | [ bmtFiles help file] ( documentation/bmtFiles.md ) |
109
- | bmtData | btmDataFunc | 601-606 | Data related | [ bmtData help file] ( documentation/bmtData.md ) |
110
-
111
-
112
- Software
113
- ----------------------
114
- The library contains six files and six functions,
115
- which contains 27 sections in total.
116
- The sections are grouped in six files as per logical function.
100
+ | bmtPrompt | bmtPromptFunc | 201-210 | Prompts | [ bmtPrompt help file] ( documentation/bmtPrompt.md ) |
101
+ | bmtNetwork | bmtNetworkFunc | 301-302 | Network related | [ bmtNetwork help file] ( documentation/bmtNetwork.md ) |
102
+ | bmtLinux | bmtLinuxFunc | 401-408 | Linux related | [ bmtLinux help file] ( documentation/bmtLinux.md ) |
103
+ | bmtFiles | bmtFilesFunc | 501-509 | File related | [ bmtFiles help file] ( documentation/bmtFiles.md ) |
104
+ | bmtData | btmDataFunc | 601-607 | Data related | [ bmtData help file] ( documentation/bmtData.md ) |
105
+ | bmtTime | btmTimeFunc | 701-709 | Time related | [ bmtTime help file] ( documentation/bmtTime.md ) |
106
+ | bmtMisc | bmtMiscFunc | 801-804 | Miscellaneous | [ bmtMisc help file] ( documentation/bmtMisc.md ) |
107
+
108
+ The library contains eight section's, Each section has one file with one function.
109
+ which contains 43 sub-sections in total.
110
+ The sections are grouped per logical function.
117
111
Printing, prompting, Linux related, file related,
118
- data related and miscellaneous.
112
+ data related, time related , network related and miscellaneous.
119
113
114
+ Output
115
+ ----------------------------
120
116
121
- ## Section numbered list
122
-
123
- * 101 Coloured printed text, 8 colours, 7 modes. 56 options in total.
124
-
125
- Colours: Black, Red, Green, Yellow, Blue, Purple, Cyan, White.
126
-
127
- Modes: normal, bold, underline, background, high intensity,
128
- bold high intensity, background high intensity.
129
-
130
- Example Output:
131
-
132
- ![ ScreenShot] ( https://raw.githubusercontent.com/gavinlyonsrepo/bashmultitool/master/documentation/screenshot/colour_print_example.png )
133
-
134
- * 201 Horizontal lines across terminal in any colour
135
- * 202 yes-no-quit [ y/n/q] prompt
136
- * 203 YES-no [ Y/n] prompt
137
- * 204 yes-NO [ y/N] prompt
138
- * 205 Anykey to continue prompt in any colour
139
- * 206 QUIT-no [ Q/n] prompt
140
- * 207 quit-NO [ q/N] prompt
141
-
142
- * 301 Check if a website is up
143
- * 302 Spinner Animation for long non-verbose commands
144
- * 303 Stopwatch / timer
145
- * 304 Weather forecast
146
-
147
- * 401 Check package installed
148
- * 402 Linux distro family checker
149
- * 403 Set text editor $EDITOR if not set
150
- * 404 log file handler
151
-
152
- * 501 Make and enter a formated directory
153
- * 502 check if directory exists and empty
154
- * 503 directory exists
155
- * 504 file exists
156
- * 505 device exists
157
-
158
- * 601 integer user input check
159
- * 602 alphabet user input check
160
- * 603 alphanumeric user input check
161
- * 604 convert string to lowercase
162
- * 605 convert string to uppercase
163
- * 606 trim whitespace from string
117
+ ![ ScreenShot] ( https://raw.githubusercontent.com/gavinlyonsrepo/bashmultitool/master/documentation/screenshot/example.png )
0 commit comments