Why my bash script behaves differently in RHEL 5.6 if compared to previous releases?

Solution Unverified - Updated -

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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content