From 21aa1d7aa513545b0b1251916ef29ea7e0d6296c Mon Sep 17 00:00:00 2001 From: Jun Wei Woon Date: Tue, 7 Jul 2020 00:04:32 +0800 Subject: [PATCH] Modified about and bash cheatsheet pages --- content/en/about/index.md | 5 +++++ content/en/posts/bash_cheatsheet.md | 33 ++++++++++++++++++----------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/content/en/about/index.md b/content/en/about/index.md index 124c2d3..a943d5d 100644 --- a/content/en/about/index.md +++ b/content/en/about/index.md @@ -58,6 +58,11 @@ I have used a few Linux distributions in the past, mainly: I have developed scripts(Python/Bash) for some of these distributions for automation, which I may share some of the scripts and its use cases in this site. In the screen shot above, there are mini scripts used to display items, for example, the status bar has scripts to display time, volume or music. The lyrics viewer is also another script I developed as I couldn't find any programs online that fits my use case. +### Bash Scripting +Some of the bash scripts I've developed can be found in my dotfiles [here](https://gitlab.com/devoalda/dotdrop-dotfiles/-/tree/master/dotfiles/local/bin). They are some installation scripts, scripts I use daily and scripts I found on the Internet that was useful to my use cases. + +_Do check it out!_ + # Text Editors/IDEs Over the years I've spent developing scripts and programs, I have used text editors for different Languages. Here are some of the editors I used in the past diff --git a/content/en/posts/bash_cheatsheet.md b/content/en/posts/bash_cheatsheet.md index 1aebdda..abd73b8 100644 --- a/content/en/posts/bash_cheatsheet.md +++ b/content/en/posts/bash_cheatsheet.md @@ -128,18 +128,27 @@ else fi ``` # Conditions -| Operator | Description | -|----------|--------------------------| -| -eq | Equal | -| -lt | Less than | -| -le | Less than or equal to | -| -gt | Greater than | -| -ge | Greater than or equal to | -| == | 2 Strings equal | -| != | 2 Strings not equal | -| ! | Statement is false | -| -d | Directory is present | -| -e | File is present | +| Operator | Description | +|-----------|--------------------------| +| -eq | Equal | +| -lt | Less than | +| -le | Less than or equal to | +| -gt | Greater than | +| -ge | Greater than or equal to | +| == | 2 Strings equal | +| != | 2 Strings not equal | +| ! | Statement is false | +| -d | Directory is present | +| -e | File is present | +| -z "$1" * | Check for empty argument | + + +{{< alert theme="info" dir="ltr" >}} +\* Note the space between the operator and argument +```bash +[ -z "$1" ] +``` +{{< /alert >}} ## Condition Usage Examples ``` bash