generic bash loop template