Created
March 22, 2016 02:54
-
-
Save KaiSforza/81641e78e2105444269e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash | |
# Script recherche | |
# TP4 420-225-LI Hiver 2016 | |
# Bénédict Brossard | |
__USERS=() | |
while true; do | |
read __USERNAME | |
[[ -n "${__USERNAME}" ]] && __USERS=(${__USERS[@]} "$__USERNAME") || break | |
done | |
for i in ${__USERS[@]}; do | |
__RET="$(awk -F: "/^([^:]*:){4}[^:]*$i/ {print \$1}" /etc/passwd)" | |
[[ -n ${__RET} ]] && echo "$__RET" || echo "----------" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment