Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7521757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:19:13+00:00 2026-05-30T02:19:13+00:00

I am Running shell script using cygwin and java. ProcessBuilder pb =new ProcessBuilder (sh,

  • 0

I am Running shell script using cygwin and java.

ProcessBuilder pb =new ProcessBuilder
("sh", "app.sh", "ib2", "12", "11", "AK-RD", "02.20", "D:\\cygwin\\bin\\test\\delta");

My script is running when i am hard coding parameters. I want to pass these parameters through text box values.

How to do this.

 String cmmd[] = new String[8];
        cmmd[0] ="\"sh\"";
        cmmd[1] ="\"app.sh\"";
        cmmd[2] ="\""+txt_threeltr.getText()+"\"";
        cmmd[3] ="\""+txt_month_c.getText()+"\"";
        cmmd[4] ="\""+txt_year_C.getText()+"\"";
        cmmd[5] ="\""+txt_partNumber.getText()+"\"";
        cmmd[6] ="\""+txt_version.getText()+"\"";
        cmmd[7] ="\""+txt_destinationname.getText()+"\"";

ProcessBuilder pb =new ProcessBuilder(Arrays.toString(cmmd));

Or is there any other way to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:19:14+00:00Added an answer on May 30, 2026 at 2:19 am

    Since ProcessBuilder has a varargs string constructor, you can do this:

    ProcessBuilder pb = new ProcessBuilder(cmmd);
    

    Alternatively, don’t construct an array. Create it like this:

    ProcessBuilder pb = new ProcessBuilder ("sh", 
                                            "app.sh", 
                                            txt_threeltr.getText(), 
                                            txt_month_c.getText(), 
                                            txt_year_C.getText(), 
                                            txt_partNumber.getText(), 
                                            txt_version.getText(), 
                                            txt_destinationname.getText());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am Executing Shell scripts in Java Using Cygwin. My Scripts are running fine
I am running a Shell script using cygwin. Process p; InputStream in; BufferedReader br;
I am running a shell script on windows with cygwin in which I execute
I am running a shell command from within my python script using os.system(some shell
I am trying to trigger the running of a shell script using PHP. Essentially,
I am running a shell script to execute a c++ application, which measures the
Is it possible to have a Perl script run shell aliases? I am running
I'm running autoconf and configure sets SHELL to '/bin/sh'. This creates huge problems. How
I'm running a third party script by using a wrapper class I've written which
I have this shell script #!/bin/sh ############################################################# # Example startup script for the SecureTrading

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.