Visit Jeremy's Blog.
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, 08:30 PM   #1
Registered: Oct 2005
Posts: 321

Rep: Reputation: 32
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, 08:51 PM   #2
Senior Member
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 4,728

Rep: Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754
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, 09:01 PM   #3
Registered: Oct 2005
Posts: 321

Original Poster
Rep: Reputation: 32

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

All times are GMT -5. The time now is 08:20 PM.

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