Added input subprocess in addition to output subprocess.

pull/91/head
Erik Brinkman 2015-06-20 19:39:29 -07:00
parent 80ba0c126d
commit 75e5b1aebf
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ Notes:
- In Bash, note there are lots of kinds of variable expansion. Checking a variable exists: `${name:?error message}`. For example, if a Bash script requires a single argument, just write `input_file=${1:?usage: $0 input_file}`. Arithmetic expansion: `i=$(( (i + 1) % 5 ))`. Sequences: `{1..10}`. Trimming of strings: `${var%suffix}` and `${var#prefix}`. For example if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`. - In Bash, note there are lots of kinds of variable expansion. Checking a variable exists: `${name:?error message}`. For example, if a Bash script requires a single argument, just write `input_file=${1:?usage: $0 input_file}`. Arithmetic expansion: `i=$(( (i + 1) % 5 ))`. Sequences: `{1..10}`. Trimming of strings: `${var%suffix}` and `${var#prefix}`. For example if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`.
- The output of a command can be treated like a file via `<(some command)`. For example, compare local `/etc/hosts` with a remote one: - The input or output of a command can be treated like a file via `>(some comand)` or `<(some command)` respectively. For example, compare local `/etc/hosts` with a remote one:
```sh ```sh
diff /etc/hosts <(ssh somehost cat /etc/hosts) diff /etc/hosts <(ssh somehost cat /etc/hosts)
``` ```