suppress echo while reading input in expect | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

suppress echo while reading input in expect

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-23-2007
sudhir_onweb sudhir_onweb is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 21 February 2009, 8:43 PM EST
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
suppress echo while reading input in expect

Hi all,

I tried searching for similar threads. Couldn't get any for Expect scripting.
I am trying automate a task which requires login to a machine. The user
would be prompted for the password. Now, I want this input to be hidden
from being displayed on the screen.

Is there any way, we can suppress echo to the terminal? Similar to the way
we do 'stty -echo' in shell script?

rgds,
Sudhir.
Sponsored Links
    #2  
Old 07-23-2007
earnstaf earnstaf is offline
Registered User
 
Join Date: May 2007
Last Activity: 15 November 2012, 10:53 PM EST
Posts: 113
Thanks: 0
Thanked 0 Times in 0 Posts
It's the same in Expect.

Code:
send_user "What is your password "
stty -echo
expect_user -re "(.*)\n" {set PASS $expect_out(1,string)}
send_user "\n"
stty echo

I've just started learning Expect myself, but I have used that piece of code successfully.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
File Reading for a certain string and echo the line before MKNENI Shell Programming and Scripting 13 03-12-2012 11:18 AM
help with echo command in reading blank spaces in aix techmoris Shell Programming and Scripting 3 02-16-2010 01:38 PM
Reading specific contents from 1 input files and appending it to another input file sksahu Shell Programming and Scripting 5 01-14-2009 05:09 AM
Reading password and echo * character alanpachuau Shell Programming and Scripting 4 04-06-2008 03:00 AM
How to suppress input keying from displaying on terminal. liteyear18 UNIX for Dummies Questions & Answers 2 07-19-2001 09:13 AM



All times are GMT -4. The time now is 06:05 PM.