Question 5: Regular expressions [9]
In either bash or perl, write a script that takes a filename (which might include a path)
as a command line argument and accurately classifies it as one of the following:
- an absolute path (begins with /)
- a relative path from a user directory (begins with ~)
- a relative path (contains a / but not an absolute path)
- a script (ends in .sh)
- a C++ program (ends in .cpp, .cc or .C)
- a text file (ends in .txt)
- a readme file (named readme, but with any combination of upper/lowercase letters)
- a simple filename (none of the above)
The script does not need to test the existence of the file or validity of the path,
it simply needs to classify it.