If I'm even halfway hungry I'll eat a meal at the airport terminal before boarding. Airport food is often not great, but it's almost always better than what's available aboard.
When there's no time to eat before boarding, or I'm not hungry (but anticipate I will be in an hour) I'll grab something to-go and eat it after I'm settled in my seat.
I agree with Paul56 that a headache is more likely caused by dehydration than undernourishment, unless you are literally starving yourself.