advanced bash scripting techniques