Hey,
I am trying to compare formated login and logout dates from one user at a host which I have stored in a tmp directory in order to find out the total login time. I need to compare them in order to find overlapping intervals.
At first I tried to store each log in and logo date in an array but it doesn't work. Can anyone help me?
loginn()
for logu in $(ls /tmp/$lognam/wtmp*)
do
logina=$(echo $(last -f $logu -F $name) | cut -c40-63)
for loga in $logina
do loginn[$i]=$(echo "$(date +"%s" -d"$loga" 2>/dev/null)")
i=$(($i+1))
done
done