bash script / function for printing progress bar in terminal