docs: update

This commit is contained in:
Dylan Araps 2018-06-13 13:59:16 +10:00
parent d5b19a5f2a
commit 93196c41e4
1 changed files with 17 additions and 0 deletions

View File

@ -30,6 +30,7 @@ scripts and not full blown utilities.
* [Get the first N lines of a file.](#get-the-first-n-lines-of-a-file)
* [Get the last N lines of a file.](#get-the-last-n-lines-of-a-file)
* [Get the number of lines in a file.](#get-the-number-of-lines-in-a-file)
* [Iterate over files.](#iterate-over-files)
* [Create an empty file.](#create-an-empty-file)
* [Strings](#strings)
* [Trim white-space from string.](#trim-white-space-from-string)
@ -117,6 +118,22 @@ lines() {
}
```
### Iterate over files.
Dont use `ls`.
```sh
# Greedy example.
for file in *; do
echo "$file"
done
# PNG files in dir.
for file in ~/Pictures/*.png; do
echo "$file"
done
```
### Create an empty file.
Alternative to `touch`.