I got a requirement to change existing script like below to search additional pattern "DB select". i tried using \| opearator but it is not working :(. Below is the existing code
echo $(cat ${1} |sed -n '/Error in/ {
N
N
N
/Too many/ {
p
}
}' >>${tmpfile})
I need to search "Too many" or "DB select"
Can some one help in this?
Below is the code i tried executing
echo $(cat ${1} |sed -n '/Error in/ {
N
N
N
/Too many\|DB select/ {
p
}
}' >>${tmpfile})
That's not a bug. That's the intended behavior according to POSIX. Some SED implementations (for example GNU) choose to disregard the fact that N should not print if EOF is reached and behave differently.