Implement dirname as a bash function. Make sure it behaves sensibly when given such arguments as /.
The dirname utility treats its argument as a pathname and writes to standard
output the path prefix—that is, everything up to but not including the last
component:
$ dirname a/b/c/d
a/b/c
If you give dirname a simple filename (no / characters) as an argument,
dirname writes a . to standard output:
$ dirname simple
.
You might also like to view...
Joe, a security analyst, is attempting to determine if a new server meets the security requirements of his organization. As a step in this process, he attempts to identify a lack of security controls and to identify common misconfigurations on the server. Which of the following is Joe attempting to complete?
A. Black hat testing B. Vulnerability scanning C. Black box testing D. Penetration testing
Desktops and traditional laptops usually have an optical disc drive.
Answer the following statement true (T) or false (F)