The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
why the below script is not working ., konankir Shell Programming and Scripting 14 03-27-2008 04:32 PM
bdf script not working !! kpatel786 Shell Programming and Scripting 3 11-16-2007 11:10 AM
Pls. Help my script not working as it should cocoabeauty1 Shell Programming and Scripting 1 07-28-2007 06:11 PM
FTP script not working rookie250 Shell Programming and Scripting 2 12-19-2006 02:49 AM
emailed reset password is not working zyx Forum Support Area for Unregistered Users & Account Problems 1 10-20-2005 01:08 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 2 votes, 3.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-04-2008
upengan78 upengan78 is offline
Registered User
  
 

Join Date: Jun 2008
Location: Texas
Posts: 142
Exclamation script not working as intended for password[SOLVED]

Hi

I have a script which uses expect and I run it on solaris 10 to set a common password for all users. I run it as `./script password` but when I tried to log into the system then I do not really have to type password, pressing ENTER on keyboard logs the user into system. (ssh)

This below is script and I feed it with a file with user names.


Quote:
#!/bin/ksh

ChangePasswd()
{
/usr/local/bin/expect <<EOF
set newpassword [lindex $argv 0]
spawn passwd $user
expect "New Password: " ## not expect "password:"
send "$newpassword\r"
expect "Re-enter new Password: " ## not expect "Re-enter"
send "$newpassword\r"
expect eof
EOF
}
#while read -p "Enter Userid:" user
while read user
do
if [[ $user != '' ]];
then
ChangePasswd $user
fi
done <ab
################### ab is file with user names

Last edited by upengan78; 06-05-2008 at 03:53 PM.. Reason: SOLVED
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0