Question 1
A file has multiple lines, each being a phone number, credit card number, or employee ID:
phone:NNN-NNN-NNNN credit:NNNN-NNNN-NNNN-NNNN employee:EMP-NNNN
Print all lines where the value (excluding dashes, and the EMP prefix for employees) is a palindrome.
Instructions
- Write your solution in script.sh.
- Read from standard input, write to standard output.
- Ignore EMP prefix for employee IDs when checking palindromes.
Sample Input
phone:123-455-4321
phone:111-222-3333
credit:1234-5678-8765-4321
credit:1221-4334-4334-1221
credit:1111-2222-3333-4444
employee:EMP-1221
employee:EMP-4334
Sample Output
phone:123-455-4321
credit:1234-5678-8765-4321
credit:1221-4334-4334-1221
employee:EMP-1221
employee:EMP-4334
Constraints
- Values follow the specified formats strictly.
- Palindrome check excludes dashes; for employee IDs exclude EMP prefix too.