How do you convert a list of files like this `error.12345678.0.0.0.0.0.0.0.0.0.0.0.0.0′ to like this `error.12345678′ ?
The total number of `.0′ s are random. Total number of error.* files are random.
Here is how you can do it
for f in error.*; do x=$f; while [[ $x = *.0 ]]; do x=${x%.0}; done; mv $f $x; done