Gliding is a means of locomotion on rigid substrates used by a number of bacteria, including myxobacteria and cyanobacteria. One of the hypotheses advanced to explain this motility mechanism hinges on the role played by the slime filaments continuously extruded from gliding bacteria. This paper solves, in full, a nonlinear mechanical theory that treats as dissipative shocks both the point where the extruded slime filament comes into contact with the substrate, called the filament's foot, and the pore on the bacterium outer surface from where the filament is ejected. I prove that kinematic compatibility for shock propagation requires that the bacterium uniform gliding velocity (relative to the substrate) and the slime ejecting velocity (relative to the bacterium) must be equal, a coincidence that seems to have already been observed.