RE: help with sed with solaris/linux password script



I had great replies and suggestions. Thank you again to everyone.

I know this is not the place to ask Linux questions, but the script broke the shadow file on our Linux servers. It worked great on our Solaris machines, but I need to figure out why the shadow file got zeroed and the backup was not created in /tmp.

Here is the revised script:

#!/bin/sh
echo "setting password for user"

# set the user password
PASSWD=passwordhere
/usr/bin/cp /export/home/scripts/passwords/shadow /export/home/scripts/passwords/shadow.orig
/usr/bin/sed -e "s/user:[^:]*\(.*\)/user:$PASSWD\1/" /export/home/scripts/passwords/shadow.orig > /export/home/scripts/passwords/shadow
/usr/bin/chmod 400 /export/home/scripts/passwords/shadow

Please help :)


---------------------------------
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers