Use ogrinfo instead. Then you don't need to create a new output if you only want to restore the .shx file.
ogrinfo
ogrinfo --config SHAPE_RESTORE_SHX YES file.shp