Hello all I am writing a shell script for unix, and I am trying to get it to ask me if instances are stopped, and then if the version of java running is correct, if not I want it to ask me to switch to the other bit version. I am newish to shell and not clear on how to to input prompts for yes/no etc, I cant get it to run properly,could someone please help?
This could be bash or ksh or something else similar. Which shell are you running in? When you know that, try man <your shell> and look for the section about the read built-in command. There are variations, but a common one allows:-
... such that the message is displayed (trailing space to make it look nice when the user types) and put the response into variable var1
its ksh, I just can't get it when i run it to prompt my questions for yes no and all, it runs through and displays all else, but just wont do that for me
you need to fix some of the errors in the script ...
1. ((VERBOSE+=1)) does not work in bash or ksh in CentOS and Solaris
2. read -y and read -b -- did not find any reference to -y and -b options to read in CentOS and Solaris
3. see treatment of variable test using [-y] compared to "-y" ...
4. [ $answer =! [-y] ] -- string not equal sign should be != ...
5. improper use of read command ...
also, you need to make your coding style consistent so it is easier to debug ... indentations would also help you a lot ...
from ...
to ...
HI
in a server we can't login with root user directly but i can login with different user and then i can switch to root user by su command
Requirement
is there anyway where i can write a script without mentioning password in file as mentioning the root password is not the... (3 Replies)
hi,
i want to execute a shell script as a different user. the flow is like this.
there is a html web page from which i have to call a shell script. web server is apache. to call the shell script from html page, a perl script is required.
so the html page calls the perl script and the perl... (2 Replies)
Hello,
I currently have glibc 2.13. I was wondering if you could teach me how to switch to : glibc2.3.2
I would really appreciate it if you tell me how to do it step by step since I am a beginner .
thanks. (1 Reply)
I need a script to change server automatically after performing some operations.
The command for changing server is ssh username@servername . Then a prompt comes to enter a password. Then i need to perform some opertaions on the other server. How can i do this in a script? (1 Reply)
Hi,
script1.sh
script2.sh
script3.sh
From above, script1.sh is the main script which is executed from root user, creates installation directory, changing ownership and execution rights etc..etc.. and finally calls scripot2.sh and script3.sh to create the database as well as for post... (1 Reply)
Hi,
I am trying to create one script where I have to login as another user inside the script to exeute some commands
How can i achieve this?
Many thanks in advance. (4 Replies)
Would like to confirm the ff. I got confused actually with the version I needed to download that will work on glassfish 3.0.1
a. Debian Squeeze (HP DL360). Need to use java version6
On Debian, I did apt-get install sun-java6-jdk. So when I check it's
java version "1.6.0_22"
Java(TM) SE... (1 Reply)
Hi Experts,
I'm trying to write a shell script to stop few things where i have to use another user to execute a command. Otherwise it will not work.
Your help is really appreciated
Thanks, (16 Replies)
Hi all,
This is my first ever post to any forum so, dont let this go in vain...........:)
Here is the scenario........
I have logged into the unix where oracle_sid is initialized for some X database in the .profile.
I have a unix script where some sql query which fetches data from X... (3 Replies)