Executing unix commands from java application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon Hawkins

    Executing unix commands from java application

    I seem to remember there's a java function for executing commands on the
    native system (UNIX in this case) but cannot remember which. Anyone know?

    Also, is it possible to grab the results of the command back into the java
    app?

    Example:

    1. Execute the 'ls -l' command on the unix machine
    2. Grab the reults back into a variable


  • hiwa

    #2
    Re: Executing unix commands from java application

    > 1. Execute the 'ls -l' command on the unix machine
    Runtime#exec()
    [color=blue]
    > 2. Grab the reults back into a variable[/color]
    Process#getInpu tStream()

    Comment

    • Simon Hawkins

      #3
      Re: Executing unix commands from java application

      Aaaah! Thats it!

      Thanks!

      Simon


      "hiwa" <HGA03630@nifty .ne.jp> skrev i meddelandet
      news:6869384d.0 402131616.316e2 [email protected] gle.com...[color=blue][color=green]
      > > 1. Execute the 'ls -l' command on the unix machine[/color]
      > Runtime#exec()
      >[color=green]
      > > 2. Grab the reults back into a variable[/color]
      > Process#getInpu tStream()[/color]


      Comment

      Working...