O'Reilly logo

A Practical Guide to Red Hat® Linux® 8 by Mark G. Sobell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

String Pattern Matching

The shell provides a powerful set of string pattern-matching operators that manipulate pathnames and other strings. These operators can delete from strings prefixes or suffixes that match patterns. The four operators are listed in Table 13-4.

Table 13-4. String Operator
# Removes minimal matching prefixes
## Removes maximal matching prefixes
% Removes minimal matching suffixes
%% Removes maximal matching suffixes

The syntax for these operators is

						${varname op pattern}
					

In this syntax op is one of the operators listed in Table 13-4, and pattern is a match pattern similar to that used for filename generation. These operators ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required