How to write a script for linux which list all users from /etc/passwd and their UID
User1 uid=0001
User2 uid=0002
...
the script should use: grep, cut, id, for
awk -F: '$0=$1 " uid="$3' /etc/passwd
awk is easier in this case.
-F defines field separator as :
so you want is 1st and 3rd colums. so build the $0
to provide your output format.
this is very basic usage of powerful awk. you may want to read some tutorials if you faced this kind of problem often.
This time you got fish, if I were you, I am gonna do some research on how to fishing.