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...

Auto Fill works only with alphabetic values

Indicate whether the statement is true or false

Computer Science & Information Technology

If you were writing a paper on the fluctuations in the prime interest rate for a BUS 211 class, you would probably use the ________ style guide

Fill in the blank(s) with correct word

Computer Science & Information Technology