Let's suppose one shaking light starts from Proxima Centauri and travels toward the earth. We know light will travel from more 4 years to reach the earth. It will be interesting if we 'look' at the travelling light in space (suppose we can), the light should be shaking in space, shouldn't it? we will see a shaking light, or a bending light. However, light should be straight away. How to explain this?
Think of the light as a stream of photons. Each photon travels in a straight line like you say, but as you shake it the photons given off by the light each get different starting positions. So as you look at the beam of light it may seem to have a wavy shape, but that's just an illusion. Like spraying water from a hose and wiggling the nozzle - the jet will look wavy but the water drops don't actually move up and down.