bash - how to remove final "dot" from directory name -


a program messed directory putting dot "." on end of file , directory names. easiest way remove them?

i have thought of removing last character not files/dirs have dot on end. removing dots problem, make extension useless.

what need rename change name.of.the.file.ext. name.of.the.file.ext , name.of.the.dir. name.of.the.dir

thanks!

go on files dot @ end, rename each if possible (i.e. target file not exist).

for file in *. ;     [[ -e ${file%.} ]] || mv "$file" "${file%.}" done echo not renamed: *. 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -