The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 11,449β€…    Votes:  3β€…
Tags: bash   scripts   syntax  
Link: πŸ” See Original Answer on Ask Ubuntu ⧉ πŸ”—

URL: https://askubuntu.com/q/1054677
Title: What is the point of the bash Null-operator ":", colon?
ID: /2018/07/13/What-is-the-point-of-the-bash-Null-operator-____-colon_
Created: July 13, 2018    Edited:  July 13, 2018
Upload: April 8, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


You can use it on the positive test of an if command when you only want to do something on the negative side. For example:

if [[ True == False ]]; then
    :
else
    echo "true <> flase"
fi

Without the : bash would generate a syntax error.

This is an oversimplified example. Generally you would use such a technique in preliminary coding when you haven’t written that code segment yet and just need something that doesn’t generate an error.

⇧ how to tell GRUB to show the user preferred names of OS'es. Ubuntu 18.04 Can I change the font of the text-mode console?  β‡©