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
.


Computer Science & Information Technology

You might also like to view...

A(n) ____________ is a method with no body that appears in a base class, and must be overridden in a (non-abstract) derived class.

a. shadow method b. base method c. derived method d. abstract method

Computer Science & Information Technology

You can adjust column dimensions by dragging the ________ indicator on the horizontal ruler

Fill in the blank(s) with correct word

Computer Science & Information Technology

In two paragraphs, discuss what conversion approach is appropriate for adopting a new automated project tracking system for the Training group.

What will be an ideal response?

Computer Science & Information Technology

Why is it appropriate to refer to a class template as a parameterized type?

What will be an ideal response?

Computer Science & Information Technology