Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrip writing for a password prompt

Status
Not open for further replies.

menace212

Programmer
Jul 11, 2003
144
US
I writing a shell script to import a password on a password prompt.. How can I enter a password on a password prompt without typing the words in...For example if I do su -help the password prompt shows up. How can I import the password automatically into the script which then writes in when the password prompt shows up...Here's a example of my script or would I need to write this C


start="su -help"
export start

echo "Starting the user help"
$start echo
????????????(password prompt)
 
Um. I think your asking how to not echo chars that are taken as input? You either need to:
- put the terminal in "raw" mode for a little while
- use curses in C/C++
- rely on another program.

Note: putting su in a script or program is often a VERY bad idea.

If it has to be a script ask this in the unix script forum.

[plug=shameless]
[/plug]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top