commit
46d700336f
5
bash.md
5
bash.md
|
@ -3,7 +3,7 @@ title: Bash scripting
|
||||||
category: CLI
|
category: CLI
|
||||||
layout: 2017/sheet
|
layout: 2017/sheet
|
||||||
tags: [Featured]
|
tags: [Featured]
|
||||||
updated: 2019-03-23
|
updated: 2019-10-02
|
||||||
keywords:
|
keywords:
|
||||||
- Variables
|
- Variables
|
||||||
- Functions
|
- Functions
|
||||||
|
@ -393,7 +393,7 @@ Note that `[[` is actually a command/program that returns either `0` (true) or `
|
||||||
if ping -c 1 google.com; then
|
if ping -c 1 google.com; then
|
||||||
echo "It appears you have a working internet connection"
|
echo "It appears you have a working internet connection"
|
||||||
fi
|
fi
|
||||||
````
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
if grep -q 'foo' ~/.bash_history; then
|
if grep -q 'foo' ~/.bash_history; then
|
||||||
|
@ -735,6 +735,7 @@ read -n 1 ans # Just one character
|
||||||
| `$?` | Exit status of last task |
|
| `$?` | Exit status of last task |
|
||||||
| `$!` | PID of last background task |
|
| `$!` | PID of last background task |
|
||||||
| `$$` | PID of shell |
|
| `$$` | PID of shell |
|
||||||
|
| `$0` | Filename of the shell script |
|
||||||
|
|
||||||
See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).
|
See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue