adjust space indent; first version: only sort the namelist.
add is_direntry
change the sequence of checking the original path and new path.
first check newpath
add sort -u to remove the duplicate items.