Sending values to command prompt


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sending values to command prompt
# 1  
Old 03-03-2010
Sending values to command prompt

hi all,
in a ksh script, how do i send username and password to the command prompt ??

also is it possible to substitute the password as **** so people running the script cant see the actual password ??


thanks in advance.
# 2  
Old 03-03-2010
https://www.unix.com/shell-programmin...-password.html

Code:
#! /usr/bin/ksh

print -n "Enter password - "
stty -echo
read PASSWORD
stty echo
print

Then just use $PASSWORD where you need it.
# 3  
Old 03-03-2010
thanks for the reply. i am writing a script which restarts an app server. when i issue the restart command in this script, it prompts me for username and password.

i know the username and password, i wanted to know how to make my ksh script write/send the username/password to the prompt ??

ta.
# 4  
Old 03-04-2010
# 5  
Old 03-04-2010
thanks for the reply. Unfortunately i dont have expect on the server i need to run my script from.

ta.
# 6  
Old 03-04-2010
What Operating System do you have (uname -a) ?

What commands are in in your ksh script to restart the application server?

Is the application server on your local machine or on a remote server? This is a very important question.

Which program wants to know a username and password ?
Is it a unix username and password or has the request come from the application for a username and password?
# 7  
Old 03-04-2010
OS : SunOS serverName 5.10 Generic_141414-07 sun4v sparc SUNW,SPARC-Enterprise-T5120

command in the shell to restart server : asadmin start-domain [serverName]
this is a sun one application server

Application server is on the same machine as the shell script.

the application server startup wants to know the username and password before it will fire up the server instance.


thanks heaps for your questions and replies so far.

Last edited by cesarNZ; 03-04-2010 at 09:52 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

2. Shell Programming and Scripting

Command prompt

Hi All, Even changing .bash_profile, i am getting only $ as command prompt. My bash profile looks like this. PS1=" $ " stty columns 200 set -o vi if i run bash command and run PS1=" $ " then it is working as expected. $ bash (4 Replies)
Discussion started by: akshu.agni
4 Replies

3. SCO

Booting to Command Prompt

Hello, I need help booting to a command prompt. The server runs SCO Openserver 5.0, with a point of sale program that automatically boots upon startup. I can't gain root access, and the administrator password for the point of sale program is un-obtainable. I am upgrading to a new point of sale... (8 Replies)
Discussion started by: tedcurvin
8 Replies

4. UNIX for Dummies Questions & Answers

Execution of command at command prompt

Hello Experts, I am still learning linux and have come across a question, hope to get some answer. I have two servers, and both have the same version of svn client installed and both have the same user_id. my SVN client version: svn, version 1.6.11 (r934486) compiled Mar 2 2011,... (4 Replies)
Discussion started by: babyPen1985
4 Replies

5. Shell Programming and Scripting

Sending values to autoprompt of pbrun

Hi I am writing a shell scrpt to call pbrun to change user like below pbrun su-otheruser but in solaris by default there ia autoprompt after using pbrun su which asks the following which is mandatory to enter the reason, Reason for ID change: Is there a way to send the value form... (3 Replies)
Discussion started by: prady184u
3 Replies

6. UNIX for Advanced & Expert Users

autosys command(autorep) from command prompt

Hi, I am using AUTOSYS GUI based tool. But I want to get the job status from the UNIX command prompt. 1. I want to execute only autorep command in the UNIX command prompt. If need to execute this command what are the settings need to do that. 2. Is it possible for executing this... (5 Replies)
Discussion started by: onesuri
5 Replies

7. Shell Programming and Scripting

sending field values in columns to output file

Hi, I am trying to send output from a shell scrip to a txt file in a colum format. I have all I can and I dont seem to understand why the results from one one particular file keeps going to the next line. How can I force all to be in one line Please see code and output below The is... (0 Replies)
Discussion started by: asemota
0 Replies

8. Windows & DOS: Issues & Discussions

Command Prompt

Hi does anyone know know how to find out the password on a vista pc using command prompt /cmd not change it (1 Reply)
Discussion started by: popo123456789
1 Replies

9. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies

10. Shell Programming and Scripting

Command prompt argument

I am beginner to UNIX, I want to write shell script for find greatest of three numbers through command prompt. I have written similar code for converting lowercase to uppercase in command prompt. I am not getting logica how to implement greatest of three numbers through command prompt. (2 Replies)
Discussion started by: giridher2000
2 Replies
Login or Register to Ask a Question