LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 12-14-2009, 08:30 PM   #1
packets
Member
 
Registered: Oct 2005
Posts: 285

Rep: Reputation: 30
is it possible in expect script


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

Quote:
#!/usr/bin/expect


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
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
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.

jlinkels
 
Old 12-14-2009, 09:01 PM   #3
packets
Member
 
Registered: Oct 2005
Posts: 285

Original Poster
Rep: Reputation: 30
@jlinkels

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


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 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


All times are GMT -5. The time now is 11:39 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration