Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. BR0200.aaa.tsv
  2. BR0200.bbb.tsv
  3. BR0200.ccc.tsv
  4. BR0210.aaa.tsv
  5. BR0210.bbb.tsv
  6. BR0210.ccc.tsv
  7. W0210.aaa.tsv
  8. W0210.aaa.tsv
  9. W0210.aaa.tsv
  10.  
  11. BR0200
  12. BR210
  13. W0210
  14.  
  15. #!/bin/bash
  16.  
  17. for file in BR* W0*; do
  18. dir = "${file%%.*}"
  19. if [-e $dir];then
  20. mv "$file" "$dir"
  21. else
  22. mkdir -p "$dir"
  23. mv "$file" "$dir"
  24. fi
  25. done
  26.  
  27. dir="${file%%.*}"
  28.  
  29. if [ -e $dir ]; then
  30. ^ ^
  31.  
  32. for file in {BR,W0}*.*; do
  33. dir=${file%%.*}
  34. mkdir -p "$dir"
  35. mv "$file" "$dir"
  36. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement