forked from e36freak/templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
36 lines (29 loc) · 958 Bytes
/
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
Various templates and example code
Files:
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
threads
More complex parallel template. Runs N jobs at a time, launching a new one
as each job finishes
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.