Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
- The problem statement, all variables and given/known data:
Write a script that displays all usernames and their UIDs in the following fashion:
name1 uid=999
name2 uid=888
... ...
- Relevant commands, code, scripts, algorithms:
grep, cut, id, echo, for...do...done
- The attempts at a solution (include all code and scripts):
I managed to list usernames and UIDs but I can't figure out how to add "uid=" string. I've been coming back to this problem for the last two days but maybe my approach is wrong. Please, help
Since I don't have a Solaris or Linux on PC, I've tested the code on tutorialspoint/execute_ksh_online.
#!/bin/bash
sort -nr -t ':' -k3 /etc/passwd | cut -d: -f1,3
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Vistula University, Warsaw, Poland, Matusiak Sawomir, CII4SP16CI-L18
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).