Pulse shaping via backward second harmonic generation.