Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Ameliorations à apporter:
- #Sauts de lignes, présentation + claire -DONE
- #Verification de nom d'user conforme et existant ou quitter. => a voir
- #Recherche par UID -DONE
- clear
- read -p "entrer un nom d'utilisateur ou un UID
- User recherché: " userRecherche
- #Recherche de la ligne de passwd
- ligneUser=$(grep $userRecherche /etc/passwd)
- #Mise en forme
- USER=$(echo $ligneUser | cut -d ":" -f 1)
- ID=$(echo $ligneUser | cut -d ":" -f 3)
- COMMENT=$(echo $ligneUser | cut -d ":" -f 5)
- HOME=$(echo $ligneUser | cut -d ":" -f 6)
- SHELL=$(echo $ligneUser | cut -d ":" -f 7)
- #Affichage
- echo ""
- echo "------------------"
- echo "USER: $USER"
- echo "UID: $ID"
- echo "COMMENT: $COMMENT"
- echo "HOME: $HOME"
- echo "SHELL: $SHELL"
- echo "------------------"
- echo ""
Add Comment
Please, Sign In to add comment