Visit Our UNIX and Linux User Community


how to Install jdk.bin using shell script with auto yes/no?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to Install jdk.bin using shell script with auto yes/no?
# 1  
Old 08-05-2009
how to Install jdk.bin using shell script with auto yes/no?

#!/bin/sh
echo "Installing Java!!!"
cd /opt
echo "Want to give execute Permissions to java!!!"
chmod 755 jdk-6u7-linux-i586.bin
echo "Executing the jdk script"
./jdk-6u7-linux-i586.bin

This is the shell commands I am using...
I want to know how to give answer to yes and no automatically here when shell ask
Do you agree to the above license terms? [yes or no]

Please guide me on this

Thanks in advance

Regards
Sandeep
# 2  
Old 08-05-2009
Hi.

Did you try:

Code:
yes | ./jdk-6u7-linux-i586.bin

for yes, and

Code:
yes no | ./jdk-6u7-linux-i586.bin

for no?
# 3  
Old 08-05-2009
Thanks buddy its working.... but how can I bypass the licence terns which i used to press Q before Yes or no....

Thanks in advance

Regards
Sandeep
# 4  
Old 08-05-2009
Hi.

Try something like:

Code:
printf "Q\nyes\n" | ./jdk-6u7-linux-i586.bin

# 5  
Old 08-06-2009
no friend i tried various options but it was not working is it Q only?

---------- Post updated 08-06-09 at 05:10 AM ---------- Previous update was 08-05-09 at 09:19 AM ----------

If some can bypass the licence terms by automatically acceptin "Q" in jdk installation?
# 6  
Old 09-09-2009
This works in Fedora 11


wget -Nc "http://dl8-cdn-03.sun.com/s/ESD6/JSCDL/jdk/6u16-b01/jre-6u16-linux-i586-rpm.bin?e=1252519776961&h=7bc60c46c5cf39e4dafc2a5e2de02050/&filename=jre-6u16-linux-i586-rpm.bin" -O jre-6u16-linux-i586-rpm.bin

chmod +x jre-6u16-linux-i586-rpm.bin

sed -i 's/agreed=/agreed=1/g' jre-6u16-linux-i586-rpm.bin
sed -i 's/more <<"EOF"/cat <<"EOF"/g' jre-6u16-linux-i586-rpm.bin

./jre-6u16-linux-i586-rpm.bin

rpm -Uvh jre-6u16-linux-i586.rpm 2> /dev/null


# Plugin-for Firefox 3.5.2 on Fedora 11
/sbin/ldconfig

ln -s /usr/java/default/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin.so

rm -f jre-6u16-linux-i586.rpm jre-6u16-linux-i586-rpm.bin
# 7  
Old 03-08-2010
using the following command able to install silently in local machine,

echo "yes" | ./jdk_version.bin &>/dev/null

but can anybody help me how to do in remote machine . i am trying the below command but it is not working,
ssh root@ipaddress_of_remotemachine echo "yes" | ./jdk_version.bin &>/dev/null

Previous Thread | Next Thread
Test Your Knowledge in Computers #105
Difficulty: Easy
The programming interface, file abstraction, built-in networking and persistent background processing are all features and capabilities supported by a Unix or Linux OS.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Usage of #!/bin/sh vs #!/bin/bash shell scripts?

Some question about the usage of shell scripts: 1.) Are the commands of the base shell scripts a subset of bash commands? 2.) Assume I got a long, long script WITHOUT the first line. How can I find out if the script was originally designed für "sh" or "bash"? 3.) How can I check a given... (3 Replies)
Discussion started by: pstein
3 Replies

2. Shell Programming and Scripting

Shell Script for Auto IP Change

Hi, I am newbie to Linux/Asterisk. I am trying to write a shell script that would look for my SIP trunk registration, if found UNREACHABLE then it would execute a command and check my local IP, if my local IP is 192.168.1.106 then it would change the IP to 192.168.1.150 and vice versa, after... (8 Replies)
Discussion started by: jeetz
8 Replies

3. Solaris

How to install java (jdk-74) on solaris 10?

What kind of required java type for installed? which address link, i need to download the package. i have zcat this version jdk-7-solaris-sparc.tar.Z and then installed each the packages with pkgadd -d . , but my java version still java full version "1.5.0_24-b02".is it need doanything after... (1 Reply)
Discussion started by: aagusman
1 Replies

4. Shell Programming and Scripting

How to install jdk 6u17 in a prompt-less script

I came across this site while Googling for how to silently install JDK 6u17. I didn't find a solution, but I came up with this hack so I thought I'd post it here: The trick is to just temporarily disable the "more" application: ]# chmod u+x jdk-6u17-linux-x64-rpm.bin ]# # Prevent prompts...... (0 Replies)
Discussion started by: mhart
0 Replies

5. Shell Programming and Scripting

How to Upgrade Jdk After install in linux

hii... i want to upgrade my java version 1.4.2 to 1.6 in linux plateform after installing JDK. so what are the steps & commands in linux to upgrade it . Please Help me ... (1 Reply)
Discussion started by: rinkugarg
1 Replies

6. UNIX for Dummies Questions & Answers

Download & install JDK 1.6

Hi.. I want to download & install JDK 1.6 for linux so please help me where i can downlod it free Regards Rinku Garg (1 Reply)
Discussion started by: rinkugarg
1 Replies

7. Solaris

error during install jdk 5.0.11 packages

hi all i tried to install jdk on solaris 10 2008 and i used these packages in installation pkgadd -d SUNWj5cfg SUNWj5dmo SUNWj5dev SUNWj5rt SUNWj5jmp SUNWj5man all was good except one (SUNWj5rt) some of the output ERROR: attribute verification of... (3 Replies)
Discussion started by: maxim42
3 Replies

8. UNIX for Dummies Questions & Answers

fuser: difference with bin/sh and bin/ksh shell script

Hi, I have a problem I don't understand with fuser. I launch a simple shell script mysleep.sh: I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted: mysleep: Then I modify my script switching from #!/bin/sh to #!/bin/ksh I launch the command fuser -fu... (4 Replies)
Discussion started by: Peuj
4 Replies

9. Shell Programming and Scripting

Script to install jdk

Hi, I need a shell script that would do silent installation of jdk on a linux machine. Can anyone help me with this? Thanx Sunny (6 Replies)
Discussion started by: eamani_sun
6 Replies

10. UNIX for Dummies Questions & Answers

Question about install JDK on SCO Unix

I try to run java file on SCO Unix, but my Unix doesn't setup with JDK environment. I go to sun.com to download JDK for SCO Unix, but there is only JDK for HP-UNIX, is it ok for SCO Unix? If it's ok, how can I install it to my Unix after I download? If it's not ok, How can I do to run java file in... (0 Replies)
Discussion started by: wendyz
0 Replies

Featured Tech Videos