This single-command BASH script file is difficult to understand, so I want to write a comment for each of the actions:
grep -R "%" values* \
| sed -e "s/%/\n%/" \
| grep "%" \
| grep -v " % " \
| grep -v " %<" \
| grep -v "%s" \
| grep -v "%d" \
| grep -v "%1$s"
I would hate having to duplicate lines, or having each comment far away from the line it applies to.
But at the same time BASH does not seem to allow "in-line" comments.
Any elegant way to solve this problem?

grephas a shell substitution in double quotes, which will replace it with whatever the shell has in that variable (which is probably nothing, given the specific variable name). Replace with single quotes to fix. – Ignacio Vazquez-Abrams Jan 28 '11 at 6:03egrep -v ' % | %<|%s'– bukzor Mar 9 '11 at 4:33