One liner shell command to find and rename to lowercase all SHP, DBF, and SHX file extensions

One liner shell command to find and rename to lowercase all SHP, DBF, and SHX file extensions starting from current directory:

EXTENSIONS="SHP SHX DBF"
for E in $EXTENSIONS ; do export E; export e=`echo $E | tr '[:upper:]' '[:lower:]'`; for f in `find . -name "*.$E"` ; do mv $f `echo $f | sed "s/$E/$e/"`; done  ; done

Useful when you get your shapefiles over from Windows and mapserver won't cooperate.

Popular posts

How to automatically import a ZFS pool built on top of iSCSI devices with systemd

Opengrep quickstart

On supplychain attacks and dependency cooldowns