I think a common strategy (at least for me) is to make good use of Linux commands and things like Awk and Sed. If it grows more than a few lines, it's often best to switch to something like Python, Perl, Tcl...etc.
I'm not really talking about making something longer just to be more clear either. I just meant all the nice libraries and Python data structures seem to allow me to do complex things in a short amount of code. Bash and Awk and all the Linux commands are great for simple things, but I haven't figured out how to handle more complex data outputs.