This paper presents an investigation of the nonlinear steepening of a gasdynamic disturbance propagating in a steady non-uniform base flow. The base flow is the steady compressible flow of a gas in a variable-area duct. The quasi-one-dimensional continuity, momentum and energy equations for the unsteady disturbance in homentropic flow are solved using the method of characteristics (wave front expansion technique). A closed-form solution for the slope of the disturbance at the wave front is obtained. The solution admits singularity for a compressive disturbance, which is responsible for the formation of shock in the flow. The solution is general and is applicable in any range of Mach number of the base flow. A special case of the steady gas flow in a convergent–divergent duct (C-D nozzle), where the flow makes a transition from subsonic to supersonic and vice versa, is investigated.