Find the answer to your Linux question:
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 ...
  1. #1
    Linux 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

    #!/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.

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    You will have to redirect the STDOUT to /dev/null
    New Users, please read this..
    Google first, then ask..

  3. #3
    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...