bash script for distribution of input file