Karaf
  1. Karaf
  2. KARAF-908

Provide a way to access system properties easily in the shell

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0, 3.0.0
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      There's no easy way to access system properties in the shell.
      Something like:

       > echo ${karaf.name}
      

      should print the system property if the session has no property named karaf.name defined.

      As a workaround, the following script can be used:

      system-property = { ((($.context bundle) loadClass java.lang.System) getMethod getProperty java.lang.String) invoke null $1 }
      echo "$(system-property karaf.name)"
      

        Activity

        Guillaume Nodet created issue -
        Jean-Baptiste Onofré made changes -
        Field Original Value New Value
        Fix Version/s 3.0.0 [ 12316040 ]
        Component/s karaf-shell [ 12313723 ]
        Guillaume Nodet made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Guillaume Nodet [ gnt ]
        Resolution Fixed [ 1 ]
        Guillaume Nodet made changes -
        Fix Version/s 2.3.0 [ 12320554 ]

          People

          • Assignee:
            Guillaume Nodet
            Reporter:
            Guillaume Nodet
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development