hi,
I have a file named user.cfg under /var/member/
#user.cfg file under /var/member/
login user: root #how are you
login pass: admin #where are you
M: user1 pass1 #20121008
M: user2 pass2 #20111230
M: user3 pass3 #20091220
M: user4 pass4 #20070210
M: user5 pass5 #20130708
M: user6 pass6 #20141008
M: user7 pass7 #20101008
.
.
.
.
M: user90 pass90 #20121222
M: user91 pass91 #20121227
M: user92 pass92 #20131102
M: user93 pass93 #20120809
What I would like to do is to have a script to read user.cfg file, it will search each line only starting with "M:" and find # sign in each line, then will check expired dates.
If the date is expired, the script shall remove related lines and will save by overwriting the existing user.cfg file.
So the output of user.cfg should be :
#user.cfg file under /var/member/
login user: root #how are you
login pass: admin #where are you
M: user5 pass1 #20130708
M: user6 pass1 #20141008
.
.
.
.
M: user90 pass90 #20121222
M: user91 pass91 #20121227
M: user92 pass92 #20131102
I have read some other threads about date comparison but none of them exactly the same with my user.cfg file.
Thanks in advance
Baris35