-
Notifications
You must be signed in to change notification settings - Fork 5
/
README
60 lines (45 loc) · 1.63 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Various templates and example code
Files:
bashrc
Various useful functions for .bashrc. Each one is described in the comments
matrix
Shows example usage of a two-dimensional associative array in bash
options
Template for the way I personally parse options in bash, allows both long
and short options
parallel
Example of a function that runs jobs in parallel
re_replace
Examples of regex searching and regex search/replace in strings using bash
pe_cut
POSIX function to replicate "${var:start:len}" in bash
sort
Examples of quicksort and shuffle functions using bash
threads
More complex parallel template. Runs N jobs at a time, launching a new one
as each job finishes
time_funcs
Various useful functions for converting human readable times to seconds,
and vice versa
transpose
AWK script, transposes a matrix/grid. For example,
a b c
e f g
h i
will become:
a e h
b f i
c g
Reads the whole file into memory in order to do so. Change the "FS = OFS ="
line to alter the field separators. An empty value (at least in gawk) will
transpose char by char.
transpose_tmp
Same as transpose, except uses a temp file instead of reading everything
into memory.
Unlike most of my repos, which use the MIT license, all of the code in this
repo is completely free to use however you want, with or without crediting me.
Honestly, I really don't care. If you DO feel the need to credit me, though,
please use the following info:
DJ Mills <dm@e36freak.com>
If you ever meet me in real life, though, feel free to buy me a brew. I like
hops.