Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5104

In JBoss Fuse shell, when running grep, there will be 3 ANSI reset sequence on each line.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.2.1
    • Fix Version/s: jboss-fuse-6.3
    • Component/s: Karaf
    • Labels:
    • Sprint:
      6.3 Sprint 4 (Mar 28 - Apr 29)

      Description

      This affect every script when using grep b/c we will have to do something to remove the ANSI reset char first..

      Here is an example to demostrate the problem (the intent is to print the final 5 characters in the value)

      JBossFuse:karaf@root> testVal = ( list | grep --color never "CSV" | tac )
      [ 212] [Active     ] [            ] [       ] [   50] Apache Commons CSV (1.1.0)
      JBossFuse:karaf@root> ( $testVal length )
      83
      JBossFuse:karaf@root> ( $testVal charAt 79 )
      )
      JBossFuse:karaf@root> ( $testVal charAt 80 )
      
      JBossFuse:karaf@root> ( $testVal charAt 81 )
      [
      JBossFuse:karaf@root> ( $testVal charAt 82 )
      m
      

      This is the code shows the reset chars are added....

      https://github.com/apache/karaf/blob/43d8cd0ae2368ce40465ea5511c5c150ec82e275/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/GrepAction.java#L144

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                sonicaaaa Paolo Antinori
                Reporter:
                roger.hui Roger Hui
                Tester:
                Jan Kasztura
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: