18/05/02 17:00:08.10 .net
改良?
cat <<'EOF' |
1st Line
2nd Li'ne
3rd Line
EOF
while read -r lineval; do
ctlino=$((ctlino + 1))
printf '%s' "${lineval}" |
sed 's/'"'"'/'"'"'"&"'"'"'/g' |
printf '%s%s' 'LINE'"${ctlino}"'='"'""$(cat)""'" '; '
done |
printf '%s%s\n' "$(cat)" ':'
とりあえず単引用符のエスケープだけ。他にも必要なものがあればsedを挟んでいけばいいんでは。