Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-908

Provide a way to access system properties easily in the shell

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: 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)"
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: