ERRO: “-bash: bin/bash: /bin/bash: bad interpreter: too many levels of symbolic links” no UCS 5.0"
I’m trying make a script for push username, hostname and date that user make login in domain
#!/bin/bash
LOG_FILE="/var/log/auth.log"
LOGIN_REGEX=“sshd.*Accepted.*for ([[:alnum:]]+@[[:alnum:]-]+) from ([[:alnum:]-]+) port [0-9]+”
while IFS= read -r line; do
if [[ $line =~ $LOGIN_REGEX ]]; then
username="${BASH_REMATCH[1]}"
hostname="${BASH_REMATCH[2]}"
login_time=$(date -d “${line:0:15}” “+%H:%M:%S”)
echo "Usuário: $username"
echo "Computador: $hostname"
echo "Hora: $login_time"
echo "----------------------"
fi
done < “$LOG_FILE”