listMaker.csh 458 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/csh
  2. # initial variables
  3. set maxFiles = 20
  4. set listDummy = "list_"
  5. #
  6. # main code
  7. set counter = 0
  8. set listCounter = 0
  9. set ListFile = "${listDummy}${listCounter}.list"
  10. touch $ListFile
  11. foreach line ( `cat $1` )
  12. @ counter += 1
  13. if ($counter == $maxFiles) then
  14. @ listCounter += 1
  15. set ListFile = "${listDummy}${listCounter}.list"
  16. touch $ListFile
  17. set counter = 0
  18. endif
  19. echo $line >> $ListFile
  20. end