#!/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 uid=$(echo "$linea" | cut -d: -f1) gid=$(echo "$linea" | cut -d: -f3) echo -e "uid: $uid\tgid: $(id -gn $gid)" fi done < /etc/passwd