From 8843c62e6dc0dd739477d925acca4af0a2450db4 Mon Sep 17 00:00:00 2001 From: Michael King Date: Wed, 2 Oct 2019 11:27:23 -0400 Subject: [PATCH 1/3] add the $0 special variable to bash.md --- bash.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bash.md b/bash.md index 9aefd8c6a..3d82da184 100644 --- a/bash.md +++ b/bash.md @@ -393,7 +393,7 @@ Note that `[[` is actually a command/program that returns either `0` (true) or ` 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 @@ -735,6 +735,7 @@ read -n 1 ans # Just one character | `$?` | Exit status of last task | | `$!` | PID of last background task | | `$$` | PID of shell | +| `$0` | Filename of the shell script | See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables). From f1a7af534f47c2b57bc84feec548164b22f47dab Mon Sep 17 00:00:00 2001 From: Michael King Date: Fri, 4 Oct 2019 17:26:14 -0400 Subject: [PATCH 2/3] update metadata --- bash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.md b/bash.md index 3d82da184..e3f57737b 100644 --- a/bash.md +++ b/bash.md @@ -3,7 +3,7 @@ title: Bash scripting category: CLI layout: 2017/sheet tags: [Featured] -updated: 2019-03-23 +updated: 2019-10-02 keywords: - Variables - Functions From 7bc72287280b091aa2ca8ab4cc6b6b3c6829141b Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 15 Oct 2019 20:30:00 +1100 Subject: [PATCH 3/3] Fix extra fences --- bash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.md b/bash.md index e3f57737b..158b6a31f 100644 --- a/bash.md +++ b/bash.md @@ -393,7 +393,7 @@ Note that `[[` is actually a command/program that returns either `0` (true) or ` 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