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

Execute native commands from the shell

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      In some "Unix shell" (vim, lftp, etc), it's possible to execute native commands using the ! character.

      It could be interesting to execute system commands from the shell. For instance, something like:

      karaf@root> !ls etc
      karaf@root> !uptime

      Of course, this feature could be disable in etc/org.apache.karaf.shell.cfg file.

        Activity

        Hide
        c.vanfleteren Christophe Vanfleteren added a comment -

        Isn't this what shell:exec does now?

        Combined with the new alias feature, you can now do

        shell:alias '! = {shell:exec $args}'
        ! uptime
        
        

        Note, there needs to be a space, otherwise jline tries to use event expansion.

        Show
        c.vanfleteren Christophe Vanfleteren added a comment - Isn't this what shell:exec does now? Combined with the new alias feature, you can now do shell:alias '! = {shell:exec $args}' ! uptime Note, there needs to be a space, otherwise jline tries to use event expansion.

          People

          • Assignee:
            Unassigned
            Reporter:
            jbonofre Jean-Baptiste Onofré
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development