Skip to content

Commit dbbcfb5

Browse files
Reorg to directories
1 parent 4982781 commit dbbcfb5

File tree

110 files changed

+2938
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+2938
-164
lines changed

README.md

+47-47
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ This guide is by SixArm.com, a software consultancy. Our customers use shell scr
66

77
Highlights:
88

9-
* [Aim for POSIX when possible because of portability and standardization](doc/aim-for-posix.md)
10-
* [Protect scripts by using `set` flags such as `set -euf`](doc/protect-scripts-by-using-set-flags.md)
11-
* [Print output with `printf` not `echo`](doc/print-output-with-printf-not-echo.md)
12-
* [Trap signals and exit by using `trap trap_exit EXIT`](doc/trap-signals-and-exit.md)
13-
* [Run executable with no file name extension](doc/run-executable-with-no-file-name-extension.md)
14-
* [Source with dot operator `.` not keyword `source`](doc/source-with-dot-operator-not-keyword-source.md)
15-
* [for arg do loop](doc/for-arg-do-loop.md)
16-
* [Parse options via `while` and `case` not `getopts` or `getopt`](doc/parse-options-via-while-and-case-not-getopts-or-getopt.md)
17-
* [Version name: use semantic versioning](doc/version-name-use-semantic-versioning.md)
18-
* [Help: use a function and HERE document](doc/help-use-a-function-and-here-document.md)
19-
* [Date & time format: use UTC and ISO8601](doc/date-time-format-use-utc-and-iso8601.md)
20-
* [Booleans: use true and false](doc/booleans-use-true-and-false.md)
21-
* [Subshells: use parentheses `$()` not backticks](doc/subshells-use-parentheses-not-backticks.md)
22-
* [Trace using set -x then set +x without printing](doc/trace-using-set-x-then-set-x-without-printing.md)
9+
* [Aim for POSIX when possible because of portability and standardization](doc/aim-for-posix)
10+
* [Protect scripts by using `set` flags such as `set -euf`](doc/protect-scripts-by-using-set-flags)
11+
* [Print output with `printf` not `echo`](doc/print-output-with-printf-not-echo)
12+
* [Trap signals and exit by using `trap trap_exit EXIT`](doc/trap-signals-and-exit)
13+
* [Run executable with no file name extension](doc/run-executable-with-no-file-name-extension)
14+
* [Source with dot operator `.` not keyword `source`](doc/source-with-dot-operator-not-keyword-source)
15+
* [for arg do loop](doc/for-arg-do-loop)
16+
* [Parse options via `whilecase` not `getopts/getopt`](doc/parse-options-via-while-and-case-not-getopts-or-getopt)
17+
* [Version name: use semantic versioning](doc/version-name-use-semantic-versioning)
18+
* [Help: use a function and HERE document](doc/help-use-a-function-and-here-document)
19+
* [Date & time format: use UTC and ISO8601](doc/date-time-format-use-utc-and-iso8601)
20+
* [Booleans: use true and false](doc/booleans-use-true-and-false)
21+
* [Subshells: use parentheses `$()` not backticks](doc/subshells-use-parentheses-not-backticks)
22+
* [Trace using set -x then set +x without printing](doc/trace-using-set-x-then-set-x-without-printing)
2323
* [Hunt for bugs by using ShellCheck](https://www.shellcheck.net)
2424
* [Fix some bugs automatically, if you want, by using Shellharden](https://github.com/anordal/shellharden)
2525

@@ -38,33 +38,33 @@ Demo:
3838

3939
## Topics
4040

41-
Argumemt parsing:
41+
Argument parsing:
4242

43-
* [Arg parse](doc/arg-parse.md)
44-
* [Parse options via `while` and `case` not `getopts` or `getopt`](doc/parse-options-via-while-and-case-not-getopts-or-getopt.md)
43+
* [Arg parse](doc/arg-parse)
44+
* [Parse options via `while` and `case` not `getopts` or `getopt`](doc/parse-options-via-while-and-case-not-getopts-or-getopt)
4545

4646
Environment variables:
4747

48-
* [Test if set or unset](doc/environment-variables/test-if-set-or-unset.md)
49-
* [$FUNCNAME function name](doc/environment-variables/funcname-function-name.md)
48+
* [Test if set or unset](doc/environment-variables/test-if-set-or-unset)
49+
* [$FUNCNAME function name](doc/environment-variables/funcname-function-name)
5050

5151
Directories:
5252

53-
* [Script directory](doc/directories/script-directory.md)
54-
* [Log directory: use $LOG_HOME](doc/directories/cache-directory-use-log-home.md)
55-
* [Data directory: use $XDG_DATA_HOME](doc/directories/data-directory-use-xdg-data-home.md)
56-
* [Cache directory: use $XDG_CACHE_HOME](doc/directories/cache-directory-use-xdg-cache-home.md)
57-
* [Configuration directory: use $XDG_CONFIG_HOME](doc/directories/configuration-directory-use-xdg-config-home.md)
58-
* [Runtime directory: use $XDG_RUNTIME_HOME](doc/directories/runtime-directory-use-xdg-runtime-home.md)
59-
* [Temporary directory:: use `mktemp`](doc/directories/temporary-directory-use-mktemp.md)
53+
* [Script directory](doc/directories/script-directory)
54+
* [Log directory: use $LOG_HOME](doc/directories/cache-directory-use-log-home)
55+
* [Data directory: use $XDG_DATA_HOME](doc/directories/data-directory-use-xdg-data-home)
56+
* [Cache directory: use $XDG_CACHE_HOME](doc/directories/cache-directory-use-xdg-cache-home)
57+
* [Configuration directory: use $XDG_CONFIG_HOME](doc/directories/configuration-directory-use-xdg-config-home)
58+
* [Runtime directory: use $XDG_RUNTIME_HOME](doc/directories/runtime-directory-use-xdg-runtime-home)
59+
* [Temporary directory:: use `mktemp`](doc/directories/temporary-directory-use-mktemp)
6060

6161
Files:
6262

63-
* [Temporary file using `mktemp` and `trap`](doc/temporary-file-using-mktemp-and-trap.md)
64-
* [Find files with filter for permission denied](doc/find-files-with-filter-for-permission-denied.md)
65-
* [Find files with special characters](doc/find-files-with-special-characters.md)
66-
* [Find files with readable permissions](doc/find-files-with-readable-permissions.md)
67-
* [Find files with executable, perm, test, exec](doc/find-files-with-executable-perm-test-exec.md)
63+
* [Temporary file using `mktemp` and `trap`](doc/temporary-file-using-mktemp-and-trap)
64+
* [Find files with filter for permission denied](doc/find-files-with-filter-for-permission-denied)
65+
* [Find files with special characters](doc/find-files-with-special-characters)
66+
* [Find files with readable permissions](doc/find-files-with-readable-permissions)
67+
* [Find files with executable, perm, test, exec](doc/find-files-with-executable-perm-test-exec)
6868

6969
References:
7070

@@ -78,35 +78,35 @@ References:
7878

7979
Conventions:
8080

81-
* [Program name using a string or basename](doc/program-name-using-a-string-or-basename.md)
82-
* [Program directory using pwd and dirname](doc/program-directory-using-pwd-andr-basename.md)
83-
* [Functions: out, err, die, big, log, now, sec, zid, cmd, etc.](doc/functions-out-err-die-big-log-now-sec-zid-cmd-etc.md)
84-
* [Assert functions: assert_empty, assert_equal, assert_match](doc/assert-functions.md)
85-
* [sec() function portability](doc/sec-function-portability.md)
81+
* [Program name using a string or basename](doc/program-name-using-a-string-or-basename)
82+
* [Program directory using pwd and dirname](doc/program-directory-using-pwd-andr-basename)
83+
* [Functions: out, err, die, big, log, now, sec, zid, cmd, etc.](doc/functions-out-err-die-big-log-now-sec-zid-cmd-etc)
84+
* [Assert functions: assert_empty, assert_equal, assert_match](doc/assert-functions)
85+
* [sec() function portability](doc/sec-function-portability)
8686

8787
Control flow statements:
8888

89-
* [While loop with index counter](doc/while-loop-with-index-counter.md)
90-
* [Do while loop](doc/do-while-loop.md)
91-
* [Case statement that skips option dash flags](doc/case-statement-that-skips-option-dash-flags.md)
89+
* [While loop with index counter](doc/while-loop-with-index-counter)
90+
* [Do while loop](doc/do-while-loop)
91+
* [Case statement that skips option dash flags](doc/case-statement-that-skips-option-dash-flags)
9292

9393
Functions:
9494

95-
* [Export function](doc/export-function.md)
96-
* [Number functions](doc/number-functions.md)
97-
* [Array functions](doc/array-functions.md)
98-
* [URL encode and URL decode](doc/url-encode-and-url-decode.md)
95+
* [Export function](doc/export-function)
96+
* [Number functions](doc/number-functions)
97+
* [Array functions](doc/array-functions)
98+
* [URL encode and URL decode](doc/url-encode-and-url-decode)
9999

100100
Command snippets:
101101

102-
* [awk match_between](doc/awk-match-between.md)
102+
* [awk match_between](doc/awk-match-between)
103103

104104
Compatibilities:
105105

106-
* [`readlink` on macOS behaves differently](doc/readlink-on-macos-behaves-differently.md)
107-
* [`realpath` is` not available on macOS default](doc/realpath-is-not-available-on-macos-default.md)
106+
* [`readlink` on macOS behaves differently](doc/readlink-on-macos-behaves-differently)
107+
* [`realpath` is` not available on macOS default](doc/realpath-is-not-available-on-macos-default)
108108

109109
PostgreSQL psql:
110110

111-
* [psql helpers](doc/psql-helpers.md)
111+
* [psql helpers](doc/psql-helpers)
112112

book/Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
top = $(shell git rev-parse --show-toplevel)
2+
key = $(shell basename ${top})
3+
4+
all: build.md ${key}.pdf
5+
6+
new: clean all
7+
8+
.PHONY: clean
9+
clean:
10+
rm -f build.md ${key}.pdf
11+
12+
build.md:
13+
echo "top:${top}"
14+
book-binder start.yml links.md build.md "${top}" "https://github.com/sixarm/unix-shell-script-tactics/doc/"
15+
16+
${key}.pdf:
17+
pandoc-from-markdown-to-pdf build.md -o ${key}.pdf

0 commit comments

Comments
 (0)