Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-441

allow GSH to support newlines

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 1.6.2
    • 1.6.0
    • None
    • None

    Description

      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
      Sent: Thursday, May 27, 2010 3:24 AM
      To: Chris Hyzer; Imholz, John J.; 'grouper-users@internet2.edu'
      Subject: Re: [grouper-users] RE: gsh.sh script whitespace problem

      --On 26 May 2010 17:06 -0400 Chris Hyzer <mchyzer@isc.upenn.edu> 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.
      > Sent: Wednesday, May 26, 2010 4:35 PM
      > To: 'grouper-users@internet2.edu'
      > 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

      Attachments

        Activity

          People

            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: