#!/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 user=$(echo "$linea" | cut -d: -f1) uid=$(echo "$linea" | cut -d: -f3) shell=$(echo "$linea" | cut -d: -f 7) if [ $shell != "/usr/sbin/nologin" ]; then echo -e "user: $user($uid)\tgid: $(id -gn $uid)($(id -g $uid))" fi done < /etc/passwd