Results 1 to 3 of 3
  1. #1
    abhijitz is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default how to run the perl script on mac terminal using java program

    perl -w /Users/santoshk/Documents/compare.pl /Users/santoshk/Documents/Actual /Users/santoshk/Documents/Expected /Users/santoshk/Documents/Difference

    I have to pass above parameters to run the script, Above command worked well if i open the terminal manually and run the command. i have to write the java code to run the above command on terminal.I have tried with following code but it did not generate the expected output.

    Runtime run = Runtime.getRuntime();
    Process p=run.exec("perl -w /Users/santoshk/Documents/compare.pl" /Users/santoshk/Documents/Actual /Users/santoshk/Documents/Expected /Users/santoshk/Documents/Difference");

    please let me know how i can run the command

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: how to run the perl script on mac terminal using java program

    Go through all four pages of When Runtime.exec() won't and apply the knowledge you gain there.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    abhijitz is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Re: how to run the perl script on mac terminal using java program

    I have gone through the pages and made necessary changes, still it is not working properly.

Similar Threads

  1. Launching perl script from Java thread
    By Looserette in forum Threads and Synchronization
    Replies: 7
    Last Post: 02-25-2011, 08:10 PM
  2. Replies: 1
    Last Post: 01-07-2011, 07:20 AM
  3. Perl in Java!
    By hakan123 in forum New To Java
    Replies: 5
    Last Post: 12-11-2009, 07:05 PM
  4. [B] How to call Perl script from Java [/B]
    By JavaEmpires in forum Advanced Java
    Replies: 7
    Last Post: 12-19-2008, 03:10 PM
  5. run perl script from java
    By maheshmhs in forum New To Java
    Replies: 0
    Last Post: 12-19-2008, 12:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •