bash: Move examples to the bottom

This commit is contained in:
Rico Sta. Cruz 2019-11-17 17:15:12 +11:00
parent c8b99a83ff
commit 7813be2238
1 changed files with 16 additions and 12 deletions

28
bash.md
View File

@ -389,18 +389,6 @@ Note that `[[` is actually a command/program that returns either `0` (true) or `
### Example
```bash
if ping -c 1 google.com; then
echo "It appears you have a working internet connection"
fi
```
```bash
if grep -q 'foo' ~/.bash_history; then
echo "You appear to have typed 'foo' in the past"
fi
```
```bash
# String
if [[ -z "$string" ]]; then
@ -749,6 +737,22 @@ cd -
pwd # /home/user/foo
```
### Check for command's result
```bash
if ping -c 1 google.com; then
echo "It appears you have a working internet connection"
fi
```
### Grep check
```bash
if grep -q 'foo' ~/.bash_history; then
echo "You appear to have typed 'foo' in the past"
fi
```
## Also see
{: .-one-column}