As a general rule.
If the question is a few lines of an actual script and the OP is asking for advice and guidance I'll simply echo their script back with edits/modifications made as an answer, with descriptions where appropriate.
If the question includes a 20+ lines of code "dump" with little else then I'll take one of the following actions:
- Investigate the OP to see if this is a one off type of question and then consider answering it.
- If they've done this many times, downvote them, leave a comment asking them what they've tried and consider voting to close, assuming that it fits one of our options to do so.
- Provide a partial answer explaining to them how to go about debugging their script, without digging in completely myself. Often times an answer to the effect of, enable debugging here, etc. to at least get the ball rolling in providing them some form of guidance so that they can ultimately either answer their own question(s) or give us further information so that a formal answer can be surmised.
One of the primary purposes of the SE sites is to provide help to others. To that end most/many of us are here to offer our expertise to others so that they can learn and grow as Unix professionals as well. There is no better way to mastering a discipline than to teach it, and so we should take each OP as that opportunity to do so, whether asking a highly technical question or with simple homework questions that they're struggling with.
But do not let them abuse your generous gift, if you feel this way then do not offer to assist this particular OP, help one of the many others that are willing to help themselves.