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}