HackerRank - Sed Command #2
April - 25/2025Problem:
For each line in a given input file, transform all the occurrences of the word 'thy' with 'your'. The search should be case insensitive, i.e. 'thy', 'Thy', 'tHy' etc. should be transformed to 'your'.
# Input
- From fairest creatures we desire increase,
- .
- .
- .
- Shall sum my count, and make my old excuse'
# Output
- From fairest creatures we desire increase,
- .
- .
- .
- Shall sum my count, and make my old excuse'
# Solution
sed -e '{s/thy/your/ig}'