Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-14-2009, 07:30 PM   #1
Registered: Oct 2005
Posts: 314

Rep: Reputation: 30
is it possible in expect script

I created a script wherein it will change password of a user


spawn passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "New UNIX password:"
send "$password\r"
expect "Retype new UNIX password:"
send "$password\r"
expect eof
My simple but noob question is can I run this script without any output. What I mean is run the script in quite mode. I don't want to output anything when I run the script. When I run the script, it output the messages found on passwd.
Old 12-14-2009, 07:51 PM   #2
Senior Member
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,497

Rep: Reputation: 636Reputation: 636Reputation: 636Reputation: 636Reputation: 636Reputation: 636
Put the statement
log_user 0
at the point where you don't want to see any output.

Before putting that in, put
exp_internal 1
at the start of the program to enable debugging. Remove it if your program is running correctly.

Old 12-14-2009, 08:01 PM   #3
Registered: Oct 2005
Posts: 314

Original Poster
Rep: Reputation: 30

Thanks! you make my day bright hhahaha I really love open source community


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
return value of expect script .. shriyer Linux - Software 9 07-10-2009 04:06 PM
Expect script help shriyer Linux - Server 3 07-08-2009 08:42 PM
Expect Script coolest Programming 7 02-16-2009 03:59 PM
Script... variables with expect? Manana Linux - Networking 1 01-19-2007 04:41 AM

All times are GMT -5. The time now is 05:41 AM.

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