I have to write a bash script for university, the text says:
Write a bash script that allows root user, to get a list of all users of the machine. Selecting a user, using select, will be required to indicate a directory (indicate the absolute path). At this point in the output will have be shown a list of all files folder owned by the user, ranked in ascending order according to the size of file.
To check if the user is root i used:
if[ "$(id -u)" = 0 ]; then
To get the list of users of the machine I was thinking of using awk:
awk -F':' '{ print$1}' /etc/passwd
How can I use select with awk? Is there another way without using awk?
Thank you so much in advance