Run unix commands from Java

Discussion in 'Java' started by Yadagiri Rao KP, Aug 5, 2003.

  1. Sir,
    I have got an assignment which tells us to executes unix commands from
    java.
    For example ,there is abutton -cat and a text field which user enters
    the extension file , when the button is pressed should list all the
    files with that extension in that directory.
    I know taht internally I will be using cat unix command .

    Please guide.
    Regards
    Yadagiri
     
    Yadagiri Rao KP, Aug 5, 2003
    #1
    1. Advertising

  2. check out java.lang.Runtime

    cheers, Andrew.

    "Yadagiri Rao KP" <> wrote in message
    news:...
    > Sir,
    > I have got an assignment which tells us to executes unix commands from
    > java.
    > For example ,there is abutton -cat and a text field which user enters
    > the extension file , when the button is pressed should list all the
    > files with that extension in that directory.
    > I know taht internally I will be using cat unix command .
    >
    > Please guide.
    > Regards
    > Yadagiri
     
    Andrew Tucker, Aug 5, 2003
    #2
    1. Advertising

  3. Yadagiri Rao KP

    Dave Miller Guest

    In article <>,
    says...
    > Sir,
    > I have got an assignment which tells us to executes unix commands from
    > java.
    > For example ,there is abutton -cat and a text field which user enters
    > the extension file , when the button is pressed should list all the
    > files with that extension in that directory.
    > I know taht internally I will be using cat unix command .
    >
    > Please guide.
    > Regards
    > Yadagiri
    >

    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec ("String with exe location and command line
    arguments");
     
    Dave Miller, Aug 5, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerome
    Replies:
    3
    Views:
    14,210
    Juha Laiho
    Jan 24, 2005
  2. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    4,008
    Thomas Stegen
    Jun 28, 2003
  3. Tim Stanka
    Replies:
    1
    Views:
    836
    Jeff Epler
    Aug 2, 2004
  4. Anand
    Replies:
    2
    Views:
    578
    Roedy Green
    May 20, 2008
  5. gravi2020
    Replies:
    0
    Views:
    1,844
    gravi2020
    Jan 15, 2009
Loading...

Share This Page