[Solved] Help with Overriding a Prompt in UNIX/Java


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] Help with Overriding a Prompt in UNIX/Java
# 1  
Old 06-26-2013
[Solved] Help with Overriding a Prompt in UNIX/Java

I am executing a shell script which contains a jar call to an external java package for which I don’t have a read access to. The external package was written in such a way that whenever we make a java –jar call to the package, it shows a prompt on the console asking if we want to continue or no (Y/N).

My requirement is to override this prompt so that there won’t be any interruption in between. Problem here is that it’s a third party jar package and I can’t(must not) edit the java code to remove the prompt.
I want to know if there any such functionality or a round about approach in Unix Shell Scripting so that I can pass the value Y in the call itself or don’t want the prompt to be displayed at all.

Thanks in advance.

CheerS

---------- Post updated at 07:41 PM ---------- Previous update was at 11:23 AM ----------

Hi all,

We were able to resolve this.

the jar call was made like,
Code:
 
java -jar xyz.jar

Now it was changed to,
Code:
echo y | java -jar xyz.jar

It works like charm.

Thanks.
Please close this thread.

Last edited by vbe; 06-26-2013 at 11:21 AM.. Reason: code tags next time thanks...
# 2  
Old 06-26-2013
Thanks for letting us know you solved...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Change the % prompt to - prompt in UNIX?

how to Change the % prompt to - prompt in unix :wall: ---------- Post updated at 07:40 AM ---------- Previous update was at 07:38 AM ---------- How To display the last modification time of any file in unix ---------- Post updated at 07:40 AM ---------- Previous update was at 07:40 AM... (2 Replies)
Discussion started by: manjiri sawant
2 Replies

2. Shell Programming and Scripting

[Solved] Prompt problem while using mget to ftp

I am writing a scritp in which first step is to get some files from a server. I am using mget to do that. here is my FTP code ... HOST="XXX.XXX.com" 28 ftp -inv $HOST <<END &> $FTP_LOG 29 quote USER $USER 30 quote PASS $PASWD 31 cd log 32 prompt off 33 binary 34 mget... (0 Replies)
Discussion started by: shashidhar
0 Replies

3. HP-UX

[Solved] Where is HP-UX JAVA 1.6 download?

Dear ALL, I am Looking JAVA 1.6 (64 Bit) for HP unix. I searched on max sites but didnt got any kindly share the details if anyone have.:confused: Ripudaman (7 Replies)
Discussion started by: ripudaman.singh
7 Replies

4. Shell Programming and Scripting

[Solved] Running scripts in parallel that issue prompt

Hi all - I am totally stuck here :wall I have been asked to write a shell script that does a few little things and then reads from a config file and kicks off an instance of another script, say scriptB.ksh for each line in the config file. These should all be run in parallel. This is all fine but... (2 Replies)
Discussion started by: sjmolloy
2 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Variable Name as a Prompt

Dear Members, I have an variable by name dir.If i do echo $dir i will get the path (/usr/bin/). I am writing a shell script which will prompt to enter the variable name if run.Suppose the script name is test.sh. If run test.sh it will prompt for entering variable name which is dir.Suppose... (9 Replies)
Discussion started by: sandeep_1105
9 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Help needed to have changing value to the command prompt string variable PS1

Hi, I am using git bash terminal window to do git operations. I have set the prompt string variable PS1 in the ~/.bashrc file as follows: export PS1=" " This is intended to show me the current git branch's name which is active as part of the prompt string. But, the problem is when I do a git... (2 Replies)
Discussion started by: royalibrahim
2 Replies

7. Programming

How do i get Java commands to be recognized in command prompt?

I would like to do some of my Java programming homework at home, and when i type things such as "javac" & "java" it does not recognize it. How do i set it up so it recognizes Java coding? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

8. Programming

How do i get Java commands to be recognized in command prompt?

I would like to do some of my Java programming homework at home, and when i type things such as "javac" & "java" it does not recognize it. How do i set it up so it recognizes Java coding? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

9. Programming

How to provide password to the prompt through Java

Hi All, I am using Ubuntu machine with JDK 6. I am running following command on shell- sudo ./somecript . Now, it prompts for sudo password and I provide the sudo password on shell and "somescript" starts running with sudo permissions. What I want to do is, I need to execute... (1 Reply)
Discussion started by: jaibhim
1 Replies

10. Shell Programming and Scripting

[Solved] trying to install pecl without having it prompt for a yes m

I want to install pecl from a single command without it asking me for a response of "yes" or "no" to finish the install... -------------------------------------------------------------------------- # pecl install pecl_http downloading pecl_http-1.7.0.tgz ... Starting to download... (1 Reply)
Discussion started by: sjsotelo
1 Replies
Login or Register to Ask a Question