Write a function called leftmatch that works similarly to the rightmatch function developed in Exercise 3. Its two arguments should be as follows:

leftmatch pattern value

Here are some example uses:
$ leftmatch /usr/spool/ /usr/spool/uucppublic
uucppublic
$ leftmatch s. s.main.c
main.c
$


# leftmost pattern value

# remove shortest matching pattern from value
# accomplished with ${var#patt}
value=$2
pattern=$1

echo ${value#$pattern}

Computer Science & Information Technology

You might also like to view...

What command below is used to test network connections by sending a request packet to a host?

A. ps B. ifconfig C. ping D. df

Computer Science & Information Technology

When you apply a filter, the Toggle Filter button is NOT active

Indicate whether the statement is true or false

Computer Science & Information Technology

In photographs, ____ is when the pupils of a subject’s eyes appear red.

a. pink eye b. red eye c. red pupils d. none of the above

Computer Science & Information Technology

The netdom command-line tool can be used to create trust relationships

Indicate whether the statement is true or false

Computer Science & Information Technology