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.
indxCls=`expr index "$doCls" ":"` doesn't work on Solaris
Petre, please solve this asap. Yarda is not here this week
Working on it
Seems I have a solution not using expr at all, simpler and faster. Still testing...
Hmm, I hate bourne shell. Need another solution, my simple and nice solution needs bash, I only happened to have bash as /bin/sh on my solaris box ;-)
I believe I've fixed it properly now. Please test it. core/launcher/unix/nbexec,v1.9
Still one expr index is used in the script.
Fixed even the second occurence, hope it is OK now.
verified on Sparc Solaris
IFS solution seems to be much better than mangling with expr. Thanks that the issue got to you -Petr, but I have executed following statement: save=$IFS; IFS=':'; for i in x:y:z ; do echo $i; done; IFS=$save and received: x y z maybe I did some mistake, but should not I get x y z instead? What is really needed is to iterate over all --clusters. Does there really work or we are not seeing immediate problems (unknown agruments to a command) on solaris?
I can't see any shell problems, this is, what I tested. I haven't tested functionality of the NetBeans itself, I suppose it'll be done by QE.
OK, Yarda, the problem is that your script use the modified IFS also for the inner loop commands, while in my patch, I do reset the IFS from inside the cycle. That way, the modified IFS is used for the setup of the loop, yet it is correct the the function called from the loop. Try putting some echos in the nbexec (e.g. inside the ..._pre_...) to verify passed agrs (so it is called for each cluster) and to check IFS. I did so and it was OK.
If we are at the bourne shell teaching course now ;-) one more note. Your example didn't work, as the literal 'x:y:z' was never processed using IFS, your loop was run only once and when $i was once substituted for echo, it was turned into three arguments. As you see, it has to go through the substitution to actually apply IFS, so try this: list="x:y:z"; save=$IFS; IFS=':'; for i in $list ; do echo $i; done; IFS=$save er even better: list='x:y:z'; save=$IFS; llist=$list; IFS=$save; for i in $llist; do echo --$i--; done Is it clear now?
Yes.
OK, just for fun, a short historical note: The very original Bourne Shell (that unportable thing running on PDP-11) even applied IFS to literals, so command IFS='o' viola would start vi on file named "la"