Suppose I have a configuration file that can be in one of two format below (short example, but basically the first format is a line that is too long that you have to use a line continuation character, while the second format is just simply a long line without the line continuation)
data1=x data2=y data3=z \
datakey
second format
data=1 data2=y data3=z datakey
I want to match the exact line data1=x data2=y data3=x datakey for both situation. Is there simple way of doing that?
read interprets \ as the line continuation character:
while read line ; do
if [[ $line == 'data=1 data2=y data3=z datakey' ]] ; then
echo "$line"
fi
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With