IT pill

Classic shell scripting (Bash, Korn Shell, etc.) is like démodé nowdays, but neverthless still used in Linux and other Unix like systems.
Therefore is still worth to mention about a static analysis tool written in Haskell https://www.shellcheck.net/
This tool will analyze your script and display each case of improper code or not following best practices.

Daily tip

How can I display a dialog box in a shell?

Through the utility dialog which must be installed.

Then you can run it in your scripts, for instance the below code:


#!/bin/bash
dialog --infobox "Installation Wizard" 6 25
sleep 1
dialog --yesno "Would you like to continue?" 12 25
if [ $? -ne 0 ]; then
    echo "User cancelled the operation!"
    exit 1
fi


Daily tip.

How do I display a substring of a variable in bash?

For example, you want to display the first seven characters from a string passed from the command line

echo ${$1:0:7}

Of course you can also save the value somewhere

substr=${$1:0:7}