Question 1
Given a list of filenames (with extensions), one per line, write a script that prints the unique file extensions, sorted alphabetically.
Instructions
- Write your script in script.sh.
- Read input from standard input.
- Extensions are case-insensitive; output in lowercase with a leading dot.
- Output should be sorted alphabetically and contain unique extensions only.
Sample Input
hello.txt
bye.pdf
cats.txt
video.mp4
music.mp3
document.docx
list.txt
song.mp3
movie.MP4
Sample Output
.docx
.mp3
.mp4
.pdf
.txt
Constraints
- Filenames always contain at least one dot.
- Extensions may be in any case; output must be lowercase.