LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > brajeshkumar
User Name
Password

Notices

Rate this Entry

Press Enter to Continue ..

Posted 04-09-2012 at 01:28 AM by brajeshkumar

Hi Friends,

Iam a begineer of shell script. When, i tried to install java 1.6 used by bash script but while executing java paused suddenly, " Press Enter to continue...." how to avoid this

i need continuously run the script file ..

My Script file

#!/bin/bash

cd /opt

./jdk-6u21-linux-i586.bin

cp -rf jdk1.6.0_21 /usr/
rm -rf /usr/bin/java
rm -rf /usr/bin/javac
ln -s /usr/jdk1.6.0_21/bin/java /usr/bin/java
ln -s /usr/jdk1.6.0_21/bin/javac /usr/bin/javac
echo export JAVA_HOME=/usr/jdk1.6.0_21 >> /etc/profile
echo export JAVA_PATH=/usr/jdk1.6.0_21/bin >> /etc/profile
source /etc/profile

Thanks & Regards

Rajeshkumar
Posted in Uncategorized
Views 3343 Comments 1
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    Fist of all it's usually recommended that such questions are made on the forums rather than as blog posts. The odds that someone will read and answer them are a bit better.


    But anyway, I don't know if whatever you're doing is a good idea to begin with, but I think you can manage to "answer" the "press enter to continue" by "piping" the script to the command "yes" (with no parameters, I guess).

    That would be:

    $ yes | ./script.sh


    I'm not sure it's really answering with the equivalent of "enter" though, I don't know how to test it for specifically "enter". It seems it works from a dummy script that is just "read variable ; echo ok". It may be better to create a post at the forums.
    Posted 04-12-2012 at 03:39 PM by the dsc the dsc is offline
 

  



All times are GMT -5. The time now is 02:18 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration