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
Post a Comment