Skip to content

Instantly share code, notes, and snippets.

@vvondra
Created March 11, 2011 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvondra/866355 to your computer and use it in GitHub Desktop.
Save vvondra/866355 to your computer and use it in GitHub Desktop.
# nactu prezencky
for f in $@
do
cat $f >> tempprezencka
done
# zjistim unikatni jmena
cat tempprezencka | sort | uniq > tempprezencka2
rm tempprezencka
# setrim cast nactenim hesel
getent passwd > passwdlist
while read line
do
grep $line passwdlist | cut -d: -f1 >> tempprezencka
grep $line passwdlist | cut -d: -f5 >> tempprezencka3
done < tempprezencka2
# slepim jmena a loginy dohromady
paste tempprezencka tempprezencka3 -d" " > tempprezencka2
cat tempprezencka2
#uklid
rm tempprezencka tempprezencka2 tempprezencka3 passwdlist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment