Advertisement
cd62131

create OUTDATA dir and rename all files

Oct 17th, 2013
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.24 KB | None | 0 0
  1. #!/bin/sh -e
  2. mkdir -p ./OUTDATA
  3. for src in $(find . -maxdepth 3 -mindepth 3 -type f -name "OUTDATA.dat")
  4. do
  5.   dest=$(echo $src | sed 's;^\./\([0-9]\+\)/\([0-9]\.[0-9]\|[0-9]\).*$;OUTDATA_\1-\2.dat;g')
  6.   echo cp $src ./OUTDATA/$dest
  7. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement