Some useful patterns in BASH