1

I have a shell script and argument as a date. I'm looking for some help in design, where I will have to create a UI and pass the date, so that it will call the shell script with an argument (it should open unix terminal and call the shell script with username and password). The whole shell script runs on LINUX server. I would preferably be on MarkLogic/Java/Unix and Scala. I should not use web server in my application.

Can someone please suggest how to call the shell script from Java application with out using an Appserver/Webserver.

2
  • Possible duplicate of calling shell script from Java Commented Aug 9, 2016 at 19:20
  • @nhouser9 : I need user interface too ,to update the date . How ever i don't have app server . I am looking for feasible solution where i have UI with out App server/Web server and it will take to the Unix shell scripting . but i don't have the design and architecture to implement Commented Aug 9, 2016 at 20:42

1 Answer 1

2

I find your actual question quite confusing and even more so after your clarification to nhouser9.

What I interpret is :
1) You need a user interface (but not a terminal?) - Your simple need may be addressed with the tried and true old timer Java Abstract Windows Toolkit (AWT). Have a look at the wikipedia page: https://en.wikipedia.org/wiki/Abstract_Window_Toolkit The sample code there compiles into a very simple Hello World GUI. (Java package info here: https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html)

2) You need to call a shell script from Java: Then for this part of the question, have a look at nhouser9's original comment. That answer can be found here: calling-shell-script-from-java The heart of this is ProcessBuilder

Add 1 and 2 together and you can create a GUI to take a parameter and then execute a shell script.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.