#!/bin/bash #Guardar IFS anterior #SAVEIFS=$IFS #IFS=$(echo -en "\n\b") #for linea in $(cat /etc/passwd); do # echo "$linea" #done #Restauramos contexto #IFS=$SAVEIFS while read linea; do echo $linea | grep /usr/sbin/nologin >/dev/null if [ $? -ne 0 ]; then user=$(echo "$linea" | cut -d: -f1) uid=$(echo "$linea" | cut -d: -f3) echo -e "user: $user($uid)\tgid: $(id -gn $uid)($(id -g $uid))" fi done < /etc/passwd