Added build files to turn the bible into a book

This commit is contained in:
Dylan Araps
2018-06-20 12:40:31 +10:00
parent e0aadbde13
commit fe6e2cd195
21 changed files with 1310 additions and 1440 deletions

View File

@@ -1,50 +1,16 @@
# File Paths
# Variables
## Get the directory name of a file path
Alternative to the `dirname` command.
**Example Function:**
```sh
dirname() {
# Usage: dirname "path"
printf '%s\n' "${1%/*}/"
}
```
**Example Usage:**
## Assign and access a variable using a variable
```shell
$ dirname ~/Pictures/Wallpapers/1.jpg
/home/black/Pictures/Wallpapers/
hello_world="test"
$ dirname ~/Pictures/Downloads/
/home/black/Pictures/
```
# Create the variable name.
var1="world"
var2="hello_${var1}"
## Get the base-name of a file path
Alternative to the `basename` command.
**Example Function:**
```sh
basename() {
# Usage: basename "path"
: "${1%/}"
printf '%s\n' "${_##*/}"
}
```
**Example Usage:**
```shell
$ basename ~/Pictures/Wallpapers/1.jpg
1.jpg
$ basename ~/Pictures/Downloads/
Downloads
# Print the value of the variable name stored in 'hello_$var1'.
printf '%s\n' "${!var2}"
```
<!-- CHAPTER END -->