Bug 58954

Summary: functions file: code typo in pidofproc() function
Product: [Retired] Red Hat Linux Reporter: rm0
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-01-28 15:28:06 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:

Description rm0 2002-01-28 15:27:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.7) Gecko/20011221

Description of problem:
The bash construct ${varname:-} is used all over the file
but in one occurrence in the pidofproc funcion the 
':' and '-'  chars have their positions swapped (demons-
trated with a small patch fixing the problem):

+++ functions   Mon Jan 28 12:00:22 2002
@@ -250,7 +250,7 @@
                for p in $line ; do
                       [ -z "${p//[0-9]/}" -a -d /proc/$p ] && pid="$pid $p"
                done
-               if [ -n "${pid-:}" ] ; then
+               if [ -n "${pid:-}" ] ; then
                        echo $pid
                        return 0
                fi


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

How reproducible:
Always

Steps to Reproduce:
1. $ less /etc/init.d/functions
2. search by -: by typing '/-:'
3. the line spotted is the bug
	

Actual Results:  
               if [ -n "${pid-:}" ] ; then



Expected Results:  should read
               if [ -n "${pid:-}" ] ; then

Additional info:

See (related) bugs #56174 and #57526

Comment 1 Bill Nottingham 2002-02-07 04:11:22 UTC
Eep. Fixed in CVS, will be in 6.53-1.