shell script to loop through N