Results 1 to 3 of 3
I created a script wherein it will change password of a user
#!/usr/bin/expect
spawn passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "New UNIX password:"
send "$password\r"
expect ...
- 12-15-2009 #1Linux Newbie
- Join Date
- Mar 2006
- Posts
- 101
is it possible in expect script
I created a script wherein it will change password of a user
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.#!/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
- 12-16-2009 #2
- 12-17-2009 #3Just Joined!
- Join Date
- May 2006
- Posts
- 4
You can redirect standrad output as well as stndard error to /dev/null.
path_to_script_name >dev/null 2>&1


Reply With Quote