bash : looping over arguments passed to a script