small tool-remove pathname with last byte being '~'