This is intended to be an approachable challenge for someone with little to no exposure to bash scripting or terminal use on a mac computer. Links to popular learning resources are provided, as well as an input file for the challenge. Please return a copy of your script to the person handling your interview process for consideration.
Oldies but goodies:
- http://linuxcourse.rutgers.edu/rute/node1.html
- http://coewww.rutgers.edu/linux/lessons/lesson9/shell_script_tutorial.html
Using the above links as starting points / reference, plus anything else you can glean from the internet, complete the following challenge:
The included file users.csv
starts with a header line and is followed by a short amount of records. Using tools already available to you via the terminal of your mac computer:
Produce a shell script which accepts the contents of the file as a pipe from a cat
, alternatively your shell script may also accept an argument on the command line in order to pass in the input file users.csv
. The script should filter for only users with the role of "actor" and should discard the header line of the input csv. Output should be a list of users on stdout in the following format, which is full name followed by email address enclosed in <>:
"FirstName LastName <email>"
The script should sort the output so the list of filtered users is presented in reverse alphabetical order by username. The script should not output any of the quotation marks from the input csv.
Please add comments to your script file explaining your approach / how your script accomplishes its goal.