LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-27-2012, 11:46 PM   #1
ghoshdastidar1980
LQ Newbie
 
Registered: Mar 2010
Posts: 9

Rep: Reputation: 0
Help require in expect script


Hi,
I have prepared two script ,[please find the attachment]
1.mypass_root.sh --- shell
2.passwd_root.expect ---- expect

1.mypass_root-->This will take the input from the user & calling the second script. I am passing the shell variable through "PUTS" in expect script.

problem is whenever i am running the scripts it is showing the o/p (mentioned in red) whatever it is taking from the 1st script.

$ ./mypass_root.sh
Enter your Lan id:testuser
Enter your Lan id password
Enter the current password of root:
Enter the account name for which you want to change the password:
enter the newpassword
testuser
testuser
XUdKfZn7
testuser
test


I am able to understand that these o/p are showing because of the following lines in the 2nd scripts
puts $env(lanid)
puts $env(lanpass)
puts $env(rootpass)
puts $env(accname)
puts $env(accpass)

But not able to hide it.Please let me know if you can help me to hide it. I have attached the two scripts.
Attached Files
File Type: txt passwd_root.expect.txt (281 Bytes, 19 views)
File Type: txt myshell.txt (494 Bytes, 10 views)
 
Old 09-28-2012, 05:41 PM   #2
Red_Man
LQ Newbie
 
Registered: Nov 2007
Location: Dallas, TX
Distribution: RHEL, CentOS, Fedora
Posts: 16

Rep: Reputation: 0
Try to put '-s' switch right after read.

read -s lanpas <- example

Hope it helps
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Expect script: how do i send function key F12 in an expect script alix123 Programming 4 09-01-2013 09:06 PM
[SOLVED] Problem in exporting variable from bash script to expect script uk.engr Linux - Newbie 3 06-14-2012 01:57 AM
Issue in running commands in expect script from shell script yadvinder Programming 0 05-31-2012 04:07 AM
[SOLVED] /usr/bin/expect : Script to check server load using both expect and bash Soji Antony Programming 1 07-27-2010 11:27 PM


All times are GMT -5. The time now is 12:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration