Hands-on task
sed: mask phone numbers in a support log
The support log /root/support.log goes to a contractor, and it contains customers' phone numbers like +7 912 345-67-89. Mask every digit of each number except the last two with asterisks — +7 *** ***-**-89 (keep the +7 country code). A line may contain two numbers. Write the result to /root/support.masked.log.
- sed -E
- capture groups
- {n} counter
- data masking
- g flag