Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- topdir=$(realpath "$1")
- orig_path_dir="$topdir-orig_path"
- tmp_dedup_dir="$topdir-tmp_dedup"
- mkdir "$orig_path_dir"
- mkdir "$tmp_dedup_dir"
- cd $1
- cnt=0;
- find . -type f | while read -r filename ;
- do
- cnt=$(($cnt+1));
- namefile="$cnt.${filename##*.}"
- namefile_path="$orig_path_dir/$namefile"
- dedup_file_path="$tmp_dedup_dir/$namefile"
- echo "$filename" > $namefile_path
- mv -v "$(cat $namefile_path)" "$dedup_file_path"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement