Why my bash script behaves differently in RHEL 5.6 if compared to previous releases?
Issue
Why upgrading the system to RHEL 5.6 from a previous RHEL 5 release causes a bash script to behave differently?
The script name is "my_script" and the problematic line is:
VAR=`ps -ef | grep -v grep | grep "my_script" | wc -l`
This line returns always 2 on RHEL 5.6 while in previous RHEL 5 version it used to return 1.
Environment
- Red Hat Enterprise Linux
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
