Bug 9506 - inelegant code in kde.csh and kde.sh
inelegant code in kde.csh and kde.sh
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: kdesupport (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-02-16 18:25 EST by Kjetil T. Homme
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-28 17:41:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kjetil T. Homme 2000-02-16 18:25:21 EST
(actually, this report is relative to rawhide, 1.1.2-10.  The code in
plain Red Hat 6.1 is broken, of course.)

This code

echo ${PATH} | grep -q ${kdepath}
if ( $status == 0 ) then
  exit
endif

can be replaced by:

if ( :"${PATH}": =~ :"${kdepath}": ) exit

Saves a process.

This is also more correct, if the user should happen to
have a) whitespace in his PATH or b) a path component like /usr/bind
:-)

A similar technique can be employed in kde.sh:

        if ! echo $PATH | grep -q "$kdepath" ; then
                PATH="$kdepath:$PATH"
        fi

becomes
	case :$PATH: in
		*:$kdepath:*) : ;;
		*)            PATH="$kdepath:$PATH" ;;
        esac

A process is saved here, as well.
Comment 1 Preston Brown 2000-08-29 13:41:35 EDT
we aren't going to be able to get this fixed in time for Red Hat Linux 7.0. 
Luckily, the impact is very low.

KDE version 2 no longer requires these scripts, either, so the problem is going
away.

Note You need to log in before you can comment on or make changes to this bug.