How can I comment on each line of the following lines from a script?
cat ${MYSQLDUMP} | \
sed '1d' | \
tr ",;" "\n" | \
sed -e 's/[asbi]:[0-9]*[:]*//g' -e '/^[{}]/d' -e 's/""//g' -e '/^"{/d' | \
sed -n -e '/^"/p' -e '/^print_value$/,/^option_id$/p' | \
sed -e '/^option_id/d' -e '/^print_value/d' -e 's/^"\(.*\)"$/\1/' | \
tr "\n" "," | \
sed -e 's/,\([0-9]*-[0-9]*-[0-9]*\)/\n\1/g' -e 's/,$//' | \
sed -e 's/^/"/g' -e 's/$/"/g' -e 's/,/","/g' >> ${CSV}
If I try and add a comment like:
cat ${MYSQLDUMP} | \ # Output MYSQLDUMP File
I get:
#: not found
Is it possible to comment here?
This will have some overhead, but technically it does answer your question:
And for pipelines specifically, there is a clean solution with no overhead:
See Stack Overflow question How to put a line comment for a multi-line command , which was closed as a duplicate of this question.