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 8733123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:34:59+00:00 2026-06-13T09:34:59+00:00

Essentially I am looking to write a shell script, likely using a for loop,

  • 0

Essentially I am looking to write a shell script, likely using a for loop, that would allow me to repeat a program call multiple times without having to do it by hand (I don’t know exactly how to explain this, but i want to perform the java TestFile.java command in the cmd window multiple times without doing it by hand).

I am trying to write it for the UNIX shell in bash, if that helps at all.

My program outputs a set of numbers that I want to look at to analyze end behavior, so I need to perform many tests for many different inputs and I want to streamline the process. I have a pretty basic understanding of shell scripting – i tried to teach myself today but I couldn’t really understand the syntax of the for loop or the syntax of how to write a .java file call, but I would be able to write them in shell script with a little help.

  • 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-06-13T09:35:00+00:00Added an answer on June 13, 2026 at 9:35 am

    This will do:

    #!/bin/bash
    
    javac Testfile.java # compile the program
    
    for((i=1;i<=50;i++))
    do
    echo "Output of Iteration $i" >> outfile
    java Testfile >> outfile
    done
    

    This will compile your java program and run it for 50 times and store the output in a file named outfile. Likewise, you can change the 50 for the number of iterations you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Essentially, I'm looking for a 1D bar-code scanner that I can program, either through
I'm looking for some direction on a script that I'd like to build. Essentially,
I'm looking for a way to write code such that when a program is
I am looking into how to write a paint program that supports undo and
I am looking for a workaround way to improvise -moz-element() using -vendor-canvas() to essentially
I'm looking for a library that could be used to manipulate audio files. Essentially
I'm trying to write a regular expression that will essentially return true if string
I'm looking to write a Python import filter or preprocessor for source files that
I'm looking to essentially write code similar to what I can do with AutoHotKey
I'm looking at a VB.NET class (that I didn't write) that is declared MustInherit

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.