Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] RE: gsh.sh script whitespace problem

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] RE: gsh.sh script whitespace problem


Chronological Thread 
  • From: "Imholz, John J." <>
  • To: "'GW Brown, Information Systems and Computing'" <>, Chris Hyzer <>, "''" <>
  • Subject: RE: [grouper-users] RE: gsh.sh script whitespace problem
  • Date: Thu, 27 May 2010 10:27:54 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US

Maybe I'm doing it wrong, but I see the need to write some gsh scripts with
loops and conditionals. Collapsing them into one line really hurts
maintainability.

It would be very useful if gsh was BeanShell + Grouper (looks like that's the
design intent of BeanShell.)
http://www.beanshell.org/

jji

-----Original Message-----
From: GW Brown, Information Systems and Computing
[mailto:]

Sent: Thursday, May 27, 2010 3:24 AM
To: Chris Hyzer; Imholz, John J.;
''
Subject: Re: [grouper-users] RE: gsh.sh script whitespace problem

--On 26 May 2010 17:06 -0400 Chris Hyzer
<>
wrote:

> When I look at the code, I *think* all commands must be on their own
> line. GSH is based on bean shell which allows multi-line commands. Not
> sure what the constraint is there, or if there is a workaround, GSH
> predates me... :)
I'm sure you are right. GSH doesn't have any parsing capability of its own
-it just passes each line to bean shell - so, in order not to break what is
there, we would have to introduce additional syntax to allow multi-line
commands e.g. use a \ at the end of any line that continues, build up the
string and pass to bean shell when we get a line not ending with \

Gary

>
> Regards,
> Chris
>
> -----Original Message-----
> From: Imholz, John J.
> [mailto:]
> Sent: Wednesday, May 26, 2010 4:35 PM
> To:
> ''
> Subject: [grouper-users] gsh.sh script whitespace problem
>
> At least I think it's a whitespace problem. I'm confused. (note: my
> subjectIds look like this: "BR549:90067")
>
> Why does this work:
> for ( subject : getMembers("foo:bar" ) ) { print(
> subject.getSubjectId().split( ":" )[1] ); }
>
>
> but this does not:
> for ( subject : getMembers("foo:bar" ) ) {
> print( subject.getSubjectId().split( ":" )[1] );
> }
> // Error: unable to evaluate command: Parse error at line 1, column 69.
> Encountered: <EOF> // Error: unable to evaluate command: Sourced file:
> inline evaluation of: `` print( subject.getSubjectId().split( ":" )[1]
> );'' : Attempt to resolve method: getSubjectId() on undefined variable or
> class name: subject // Error: unable to evaluate command: Parse error at
> line 1, column 1. Encountered: }
>
> jji



----------------------
GW Brown, Information Systems and Computing




Archive powered by MHonArc 2.6.16.

Top of Page