The command patch -R -p0 -s -f --dry-run < abc.patch fails with exit code 1 and prints a error message from patch command but when used with negation in a if condition it passes (i.e prints yesPass), below is the code
if ! patch -R -p0 -s -f --dry-run < abc.patch; then
echo "Pass"
fi
What I tried ? I redirected string dev/null no change in result
Please help me understand what's going wrong in here ?