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.
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
phone:123-455-4321
credit:1234-5678-8765-4321
credit:1221-4334-4334-1221
employee:EMP-1221
employee:EMP-4334
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 ```text 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 ```text 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. Given t numbers, compute the running XOR of all inputs so far and print it. Stop as soon as the running XOR is composite. ## Instructions - Write your solution in script.sh. - First line of input is t; next t lines are positive integers. - For each integer (in order), print the running XOR so far. - Stop processing as soon as the running XOR is composite. ## Sample Input ```text 10 97 12 16 62 25 16 28 84 83 23 ``` ## Sample Output ```text 97 109 125 ``` ## Explanation - After 97: XOR = 97 (prime) -> print. - After 12: XOR = 97 ^ 12 = 109 (prime) -> print. - After 16: XOR = 109 ^ 16 = 125 (composite: 5^3) -> print, stop. ## Constraints - 1 <= t <= 100, 1 <= n <= 100 Each line has the format case:text where case is low or up. If case is low and text has no lowercase letters, convert to lowercase. If case is up and text has no uppercase letters, convert to uppercase. Otherwise leave text as-is. Always remove the case: prefix. Print only the text part. ## Instructions - Write your solution in script.sed. - Run as: sed -Ef script.sed < input.log ## Sample Input ```text low:THIS IS A LOW CASE MESSAGE up:This is an Up Case Message ``` ## Sample Output ```text this is a low case message This is an Up Case Message ``` ## Constraints - Text contains only [a-zA-Z ].