i have files as xyz001.csv, xyz002.csv.......xyz0025.csv in a folder, i need to keep xyz001.csv as it is
but want to remove the extra zero on filename from 10 say
xyz0010 should be renamed to xyz010
xyz0025 should be renamed as xyz025
Note xyz can be anything xyz1 or xyz2 or abc .......
#!/bin/ksh
typeset -Z3 i=0 # Define as three digit with leading zeros
typeset -i j=0 # Define as a plain integer
until [ $i -gt 25 ]
do
((i=$i+1))
j=$i
mv xyz000$j.csv xyz$i.csv
done