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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:31:09+00:00 2026-05-28T02:31:09+00:00

I have a shell script which executes a various of commands like killing processes,

  • 0

I have a shell script which executes a various of commands like killing processes, copying files via scp, performing remote commands via ssh and etc…

The problem is that this script is hard to maintain and hard to unit test.
Moreover, I want in the future to change it so it would work with xml config file, and I think that it cant be easily done with shell scripts.
So, I want to transform it to a java application, but just running many commands with ProcessBuilder doesn’t feel right.

On the other hand, searching for java solutions for each “problem” that today is easily solved in shell commands (like java ssh client, java API for linux processes and etc..), also doesn’t feel right.

EDIT:
I know for sure that my program will run in a linux environment, so cross platform is a non-issue here.

Any suggestion?

  • 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-28T02:31:09+00:00Added an answer on May 28, 2026 at 2:31 am

    I’ve used many languages for shell scripting; from Python, PHP, to Java – and I keep coming back to using the right tool for the job.

    In the linux world, bash scripting is usually powerful enough, and perl has lots of good OS support.

    It has surprised some of our developers in the past, that you can actually build functions within bash scripts, hand around state and manage a lot of what you’d normally expect. It’s just another language, but with the command line at the heart of it.

    UPDATE:

    Another thing I’d add is follow the principle of least astonishment, which in this case means that you should write the code to be what those managing the system would expect. All too often I see Java programmers writing their deployment like Java programmers, not system administrators. If you’re going to be handing these scripts over to a system administrator / operations role, then they are likely to be more familiar with shell scripts than a Java program they would have to compile.

    On another note – treat your shell scripts like proper code. Put it in source control (my whole /etc is under Git management), have a bug tracking system, etc. It makes maintenance much easier.

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

Sidebar

Related Questions

I have a PHP script which executes a shell command: $handle = popen('python last',
I have a shell script which copies a few files to the current directory,
I have a Bash shell script in which I would like to pause execution
I have a shell script that executes a number of commands. How do I
So I have a cronjob which executes a PHP script like so: 0 0
Hi I have a shell script which should run based on the return of
I have a unix shell script which test ftp ports of multiple hosts listed
Have a shell script that reads the files in a particular directory. #!/bin/bash for
I have a shell script which I execute frequently in a day with different
I have a script in app/vendors/shells which is executed periodically via cron. In that

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.