Created
January 14, 2019 21:28
-
-
Save maciektr/eaf4775b95c3ef2d01bb449da112759e to your computer and use it in GitHub Desktop.
Skrypt z laboratoriów z unixów
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 | |
if [ $# -eq 0 ]; then | |
echo -n "Podaj UIDs: " | |
read NUMERY | |
else | |
NUMERY=$* | |
fi | |
for NUM in $NUMERY; do | |
OPIS=`cat /etc/passwd | cut -d : -f 3,5 | grep "^$NUM:" | cut -d: -f2` | |
if [ "$OPIS" ]; then | |
echo "$NUM to $OPIS" | |
else | |
echo "$NUM opis pusty" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment