Bug 709774

Summary: ksh handling variable assignment with the use of multiple pipes and different variable assignment mechanisms
Product: Red Hat Enterprise Linux 5 Reporter: Dave Sullivan <dsulliva>
Component: kshAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-tools-bugs
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.5CC: mfranc, ovasik, prc
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 736056 (view as bug list) Environment:
Last Closed: 2011-10-25 12:24:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 736056    

Description Dave Sullivan 2011-06-01 15:29:27 UTC
Description of problem:

In consistency on how ksh performs the following.

#1
IsRunning=`ps -ef |grep /home/elcaro/scripts/cron/spool_purge_co_appl_log | grep -v grep| grep -v eflex | wc -l`

#2
IsRunning=$(ps -ef |grep /home/elcaro/scripts/cron/spool_purge_co_appl_log | grep -v grep| grep -v eflex | wc -l)

ps -ef |grep /home/elcaro/scripts/cron/spool_purge_co_appl_log | grep -v grep| grep -v eflex | wc -l | read IsRunning

The #1 backtic way seems like obsoleted way of doing it. The #2 way should work.  And the #3 way works.

Version-Release number of selected component (if applicable):

RHEL5.1/ksh-20060214-1.4:       1/1  (works)
RHEL5.2/ksh-20060214-1.7:       1/1  (works)
RHEL5.3/ksh-20080202-2.el5:     1/1  (works)
RHEL5.4/ksh-20080202-14.el5:    1/1  (works)

RHEL5.5/ksh-20100202-1.el5:     1/2  (doesn't work)
RHEL5.6/ksh-20100202-1.el5_6.3: 1/2  (doesn't work)
RHEL6.0/ksh-20100621-6.el6:     1/2  (doesn't work)


How reproducible:


Steps to Reproduce:
1. Write a simple script similar to above using say top instead
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 5 Michal Hlavinka 2011-10-25 12:24:29 UTC

*** This bug has been marked as a duplicate of bug 736195 ***