Guest User

Untitled

a guest
Nov 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. 1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44
  2. 000001abcde20140718023216001.txt.34568.001.2014_07_07_13:50:44
  3. 44444abcded20140718023216001.txt.1111111.2014_07_07_13:47:44
  4.  
  5. 1234551abcde20140718023216001.txt.809047512
  6. 000001abcde20140718023216001.txt.34568.001
  7. 44444abcded20140718023216001.txt.1111111
  8.  
  9. #!/usr/bin/ksh
  10. file1=`echo 1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44 | awk -F "." '{for(i=1;i<NF;i++) if ($i!= 1) f=f?f FS $i:$i;print f;f=""}'`
  11. echo $file1
  12.  
  13. for x in *.txt.*.*; do
  14. mv "$x" "/other/directory/${x%.*}"
  15. done
Add Comment
Please, Sign In to add comment