Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEGIN{
- "who | wc -l" | getline whoLineCount
- for(i ; i < whoLineCount; i = i + 1){
- "who" | getline whoData
- split(whoData,resultWho," ")
- "grep -e" resultWho[1] " /etc/passwd" | getline passwdGrep
- split(passwdGrep, resultPassw, ":")
- array[resultWho[1]] = array[resultWho[1]] + 1
- result[resultWho[1]] = " Name : " resultWho[1] ", User dir : " resultPassw[6] ", Nb co : " array[resultWho[1]]
- }
- for(i in result){
- print result[i]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement