#!/bin/bash USUARIO=$1 TITULOS=( "Nombre" "ContraseƱa" "UID" "GID" "Comentario" "Directorio Home" "Shell" ) # if [[ -z $USUARIO ]]; then # echo "Usage: ./script1.sh root" # exit # fi # getUserInfo() { USER=$1 IFS=':' COUNT=0 for v in $USER; do echo "${TITULOS[$COUNT]}: $v" let COUNT++ done } main() { while read -r v; do # I hate this getUserInfo "$v" echo "--------------------" done