Dear Expert,
I have made a script for check the expired user and it will send alert if the password will expire less than 8 days.
but the script error. Please help me....
And if you can please pass on the output / error of the script, don't you think it may help the people around to give the solution steadfast?
Secondly, I could run the script that you posted above, but the passwd file is not there in my system.
Code:
# ls -ltr /etc/security/passwd
ls: /etc/security/passwd: No such file or directory
And if you can please pass on the output / error of the script, don't you think it may help the people around to give the solution steadfast?
Secondly, I could run the script that you posted above, but the passwd file is not there in my system.
Code:
# ls -ltr /etc/security/passwd
ls: /etc/security/passwd: No such file or directory
the error is
Code:
./scriptalertpasswd.sh[7]: echo(7257600 - 691200): not found.
syntax error on line 1 stdin
./scriptalertpasswd.sh[16]: test: 0403-021 A ] character is missing.
syntax error on line 1 stdin
./scriptalertpasswd.sh[16]: test: 0403-021 A ] character is missing.
syntax error on line 1 stdin
./scriptalertpasswd.sh[16]: test: 0403-021 A ] character is missing.
./scriptalertpasswd.sh[7]: echo(7257600 - 691200): not found.
syntax error on line 1 stdin
./scriptalertpasswd.sh[16]: test: 0403-021 A ] character is missing.
syntax error on line 1 stdin
./scriptalertpasswd.sh[16]: test: 0403-021 A ] character is missing.
syntax error on line 1 stdin
./scriptalertpasswd.sh[16]: test: 0403-021 A ] character is missing.
Are you trying to compute the difference in alertperiod=`echo"($changeperiod - $remindperiod)"`
If that is the case:
Can you see the extra e that is in bold appended to changeperiod variable? That is causing the pain
Hence the error:
Code:
scriptalertpasswd.sh[16]: test: 0403-021 A ] character is missing.
syntax error on line 1 stdin
./scriptalertpasswd.sh[16]: test: 0403-021 A ] character is missing.
Make the code like this:
Code:
#!/bin/ksh
# Script for check whose password will expire in 8 days
#
currentdate=`perl -le 'print time'`
changeperiod=$((84*86400))
remindperiod=$((8*86400))
alertperiod=$((changeperiod - remindperiod))
lastchange=`awk '/:/ {name=$1} ; /lastu/ {print name $3}' /etc/security/passwd`
for user in $lastchange
do
username=`echo $user | cut -f 1 -d:`
lastupdate=`echo $user | cut -f 2 -d:`
alertdate=$((alertperiod + lastupdate)) #" | bc`
expireddate=$((changeperiod + lastupdate)) #" | bc`
if [$alertdate -le $currentdate]; then
echo $username " "`perl -le "print scalar localtime ($expireddate)"` > /home/user3/expireduser.txt
fi
done
Hi everyone
Please i need urgent help...
I have installed solaris 11 using live media.. then i installed sunray.. every thing is fine.. but after system reboot i am unable to login on server on GUI it gives account expired error or some time authentication failed... but i can log in through... (11 Replies)
// AIX 6.1
In need of finding which AIX user accounts will be expired and are
locked.
I have placed the following parameters under /etc/security/user... (1 Reply)
I've created an hmc user account for our developers and set a pawword expiry to 30 days. Trouble is when the password expires they are asked to change it in the WebSM gui but it returns an error "XXXX check log file /var/websm/data/....log" which doesn't exist.
I've tried resetting the password... (0 Replies)