Usando uma pequena construção while
:
% i=1; while IFS= read -r line; do printf '%s. %s\n' "$i" "$line"; ((i++)); done <file.txt
1. This is the first line
2. This is the second line
3. This is the third line
4.
5. This was a blank line
Expandido:
#!/usr/bin/env bash
i=1
while IFS= read -r line; do
printf '%s. %s\n' "$i" "$line"
((i++))
done <file.txt