Reputation: 12522
I have a bash script that reads lines from stdin.
while read var
do
echo $var
done
Now, I have to modify this so I could accept input with line delimiter "EndOfMessage" (delimiter of several symbols).
How could I do that?
Upvotes: 0
Views: 2045
Reputation: 125788
If I understand this right, the input will be something like "line1EndOfMessageline2EndOfMessageline3"? If so, you can do it like this:
sed $'s/EndOfMessage/\\\n/g' | while read var; do
echo $var
done
Upvotes: 1