Anonymous user
String matching: Difference between revisions
awk cannot use ~ unless sanitized string, use index instead
(awk cannot use ~ unless sanitized string, use index instead) |
|||
Line 998:
<lang AWK>#!/usr/bin/awk -f
{
print $1 " " ( substr($2,index($2,$1))==$1 ? "ends" : "does not end") " with " $2
▲ print $1" does not begin with "$2;
▲ print $1" does not contain "$2;
}
</lang>
|