Bug 9506 - inelegant code in kde.csh and kde.sh
Summary: inelegant code in kde.csh and kde.sh
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kdesupport
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-02-16 23:25 UTC by Kjetil T. Homme
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-02-28 22:41:32 UTC
Embargoed:


Attachments (Terms of Use)

Description Kjetil T. Homme 2000-02-16 23:25:21 UTC
(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 17:41:35 UTC
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.