Assigned 27 Oct, due 10 Nov. Write a program, in C, named "wsp" (this stands for "where search path"). Your program will take two command-line arguments. The first is the name of an environment variable whose value is a list of directories, separated by colons (e.g. PATH); the second is the name of a file. Your program will look in each of the directories in turn, find out whether that directory contains a readable file with the specified name, and print the results on the screen in some friendly form. Your program should handle errors (e.g. wrong number of arguments, first argument not the name of an environment variable, nonexistent directory, etc.) gracefully, printing an informative error message rather than crashing. The list of directories may contain absolute pathnames, relative pathnames, and "." and ".." notation; it will not contain "~" and "~userid" notation. Example: panther% ls snark dir1 dir2 panther% ls dir1 thisfile thatfile the_otherfile panther% ls dir2 thisfile thatfile dir3 panther% ls dir2/dir3 thatfile snark boojum words panther% ls /usr/share/dict README british hlista hstop words american hlist hlistb stop panther% setenv DICTPATH dir2/dir3:/usr/share/dict:. panther% wsp DICTPATH words dir2/dir3/words /usr/share/dict/words panther% wsp DICTPATH snark dir2/dir3/snark ./snark panther% wsp DICTPATH american /usr/share/dict/american panther% wsp DICTPATH thisfile "thisfile" not found panther% setenv DICTPATH dir2/dir3:/usr/share/dict:dir1:. panther% wsp DICTPATH thisfile dir1/thisfile EXTRA CREDIT 1: Some users may mistakenly type "wsp $DICTPATH snark" instead of "wsp DICTPATH snark". Write your program so that it still works in this case. EXTRA CREDIT 2: Allow two optional flags "-f" and "-q", which may be combined in any order ("-f -q", "-q -f", "-fq", or "-qf"), and which may only appear before the arguments. If the "-f" flag is provided, the program only prints out the FIRST match it finds, rather than all matches; if the "-q" flag is provided and the program finds nothing at all, it prints nothing at all rather than a "not found" message. EXTRA CREDIT 3: Handle the "~" and "~userid" notation correctly if they appear in directory names in the path. (The only way I can think of to do this is to look them up in the passwd database, which would be fairly difficult in a C program. But maybe there's an easier way.) HINTS: The way I envision writing this program, you'll need to use argc and argv, the "getenv" library function, and the "strchr", "strcat", "strcpy", and related library functions. To find out whether a file with a specified name exists in a specified directory and is readable, I suggest using "fopen" and trying to open the file for read access. If so, you should immediately close it again, so as not to leave a lot of open files lying around.