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
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
Total Comments 1
Comments
-
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