Concat, substring in bash shell or commandline

Written on 22 July 2016

  1. Concat
$ var1=a
$var2=b
$var12=$var1$var2

2. Substring
Script bellow will remove :number chars in beginning of string in bash shell.

string="1234567890" && echo "${string:2}"  
string="1234567890" && echo "${string:3}"  
string="1234567890" && echo "${string:4}"  
string="1234567890" && echo "${string:5}"