結果 : bash script wait for function to finish