Instead of what you tried:
cat ${MYSQLDUMP} | \ # Output MYSQLDUMP File
Others have mentioned that this should work:
cat ${MYSQLDUMP} | # Output MYSQLDUMP File
Since split lines won't always end in a pipe (|), though, you can put comments on their own line, like this:
date && \
# List current directory
ls -l | awk '{ \
# Filename is in the ninth column
# This is just making "ls -l" work mostly like "ls -1"
print $9 }'
Just don't do so in the middle of a string:
echo " Hello \
# Localized name for your planet:
world."
In your case, you can use this method:
cat ${MYSQLDUMP} | \
# Output MYSQLDUMP File
Extended example:
# Create .csv file from MySQL dump file
cat ${MYSQLDUMP} |
# Output MYSQLDUMP File
# and pipe to first sed command
sed '1d' | \
# Pipe output to tr
tr ",;" "\n" | \
# Apply sed expression
sed -e 's/[asbi]:[0-9]*[:]*//g' -e '/^[{}]/d' -e 's/""//g' -e '/^"{/d' | \
# Apply another two sed expressions
# (and since whitespace is ignored, you can intent for clarity)
sed -n -e '/^"/p' -e '/^print_value$/,/^option_id$/p' | \
# Apply three more sed expressions
sed -e '/^option_id/d' -e '/^print_value/d' -e 's/^"\(.*\)"$/\1/' | \
# Use tr to ...
tr "\n" "," | \
# Apply yet another two sed expressions
sed -e 's/,\([0-9]*-[0-9]*-[0-9]*\)/\n\1/g' -e 's/,$//' | \
# Apply the final three sed expressions
sed -e 's/^/"/g' -e 's/$/"/g' -e 's/,/","/g' >> ${CSV}
... or mix both methods:
# Create .csv file from MySQL dump file
cat ${MYSQLDUMP} | # Output MYSQLDUMP File
# and pipe to first sed command
sed '1d' | \
# Pipe output to tr
...
(I believe both methods work since shell script files are parsed line-by-line, as is CLI input.)
Final notes:
It is important to remember that the line continuation character (\), when used, should be the last character in that line (even a single forgotten trailing space can ruin your evening).
If typing manually from the command line, use only the second method (with each comment on its own line) if you intend on using the command history feature.
If using history and want comments preserved, do not use either of these methods - use one from a different answer to this question.