Advertisement
Guest User

Untitled

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