Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. FILE="parsed"
  4. COUNTRY="countrycodes"
  5.  
  6. cat $FILE |while x=`line`
  7. do
  8. cat $COUNTRY | cut -d':' -f 2 | while y=`line`
  9. do
  10. while y=`echo "$x" | awk -F: '$12 ~ /'"$y"'/ {print $12}'` # Just not sure if i can do like that
  11. do
  12. test -d /tmp/outputs || mkdir /tmp/outputs
  13. test -f /tmp/outputs/$y.txt || touch /tmp/outputs/$y.txt
  14. cat $x >> /tmp/outputs/$y.txt
  15. echo "$y.txt has grown to `wc -l src|cut -d' ' -f1` lines
  16. done
  17. done
  18. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement