This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 109021

Summary: reset GREP_OPTIONS in bash startup script
Product: platform Reporter: javajoe <javajoe>
Component: -- Other --Assignee: issues@platform <issues>
Status: NEW ---    
Severity: blocker CC: arekm, mbiggerstaff7, pchytil
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description javajoe 2007-07-06 14:33:06 UTC
This is quite unusual, but if a linux user has the GREP_OPTIONS set in their shell (to help highlite grep searches), it
will mess up the memory allocation routine in heap_size() (netbeans bash startup script)

The fix:
add the following to the Linux case:

export GREP_OPTIONS=

You may want to place it earlier in the script, but this worked for me. This allows the next line which tries to read
the meminfo to work, rather then get a blank value for $mem

snip-it below
...
heap_size () {
    mem=128
    case "`uname`" in
        Linux*)
--->>   export GREP_OPTIONS=
        mem=`cat /proc/meminfo | grep MemTotal | tr -d [:space:][:alpha:]:`
        mem=`expr $mem / 4096`
        ;;
    SunOS*)
        mem=`/usr/sbin/prtconf | grep Memory | /usr/xpg4/bin/tr -dc '[:digit:]'`
        mem=`expr $mem / 4`
        ;;
# Disable the heuristics on Mac until we resolve #106965
...
Comment 1 Petr Chytil 2008-09-17 11:45:19 UTC
reassigning to core/code
Comment 2 Twister 2014-04-24 09:27:53 UTC
*** Bug 196430 has been marked as a duplicate of this bug. ***