The following is working as expected at command prompt. But it does not work from cron.
# echo "test abc xyz" | grep "test1 \| pqr" # echo "test abc xyz" | grep "test \| pqr" test abc xyz
When I use this statement in the cron, I need to escape certain characters. But I am not able to figure it out.