Re: Why does this only work when I am running a shellscript

Discussion in 'Java' started by RVic, Mar 30, 2013.

  1. RVic

    RVic Guest

    Roedy, Isn't there a way for Java to "execute" a raw script? I recall doing this once but cannot find my old code.RVic
    RVic, Mar 30, 2013
    #1
    1. Advertising

  2. RVic

    Joerg Meier Guest

    On Sat, 30 Mar 2013 08:41:17 -0700 (PDT), RVic wrote:

    > Roedy, Isn't there a way for Java to "execute" a raw script? I recall doing this once but cannot find my old code.RVic


    You have replied to the wrong post - your own, instead of Roedys. That
    makes your thread hard to read for those trying to help you.

    You can execute a raw script by executing (ba)sh (or cmd.exe under Windows)
    and using the script as a parameter.

    That being said: if your script is properly formatted (meaning the first
    line looks like #!/bin/bash or whatever), it should be no problem executing
    it the way you do now.

    Liebe Gruesse,
    Joerg

    --
    Ich lese meine Emails nicht, replies to Email bleiben also leider
    ungelesen.
    Joerg Meier, Mar 31, 2013
    #2
    1. Advertising

  3. RVic

    Roedy Green Guest

    On Sat, 30 Mar 2013 08:41:17 -0700 (PDT), RVic <>
    wrote, quoted or indirectly quoted someone who said :

    >Roedy, Isn't there a way for Java to "execute" a raw script? I recall doing this once but cannot find my old code.RVic


    sure. Exec a command processor with the script as a parm. See
    http://mindprod.com/jgloss/exec.html for examples.
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    Motors make noise, and that tells you about the feelings and attitudes
    that went into it. Something was more important than sensory pleasure --
    nobody would invent a chair or dish that smelled bad or that made horrible
    noises -- why were motors invented noisy? How could they possibly be
    considered complete or successful inventions with this glaring defect?
    Unless, of course, the aggressive, hostile, assaultive sound actually served
    to express some impulse of the owner.
    ~ Philip Slater (born: 1927 age: 85)
    The Wayward Gate: Science and the Supernatural
    Roedy Green, Apr 1, 2013
    #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. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,840
    Smokey Grindel
    Dec 2, 2006
  2. Barb Knox
    Replies:
    1
    Views:
    258
    Steven Simpson
    Mar 30, 2013
  3. markspace
    Replies:
    1
    Views:
    261
    Arne Vajhøj
    Mar 30, 2013
  4. Roedy Green
    Replies:
    0
    Views:
    230
    Roedy Green
    Mar 30, 2013
  5. Steven Simpson
    Replies:
    0
    Views:
    235
    Steven Simpson
    Mar 30, 2013
Loading...

Share This Page