I need to change the first letter of every line in a file to uppercase, e.g.
the bear ate the fish.
the river was too fast.
Would become:>
Pure bash
:
while read x ; do echo "${x^*}" ; done < inputfile > outputfile
Test/demo (remove the code after done
for more complete output):
for f in a, a, á, à, ǎ, ā, b, c, d, e, e, é, è, ě, ē, f, g, h, i, i, í, ì, ǐ, ī, \
j, k, l, m, n, o, o, ó, ò, ǒ, ō, p, q, r, s, t, \
u, u, ú, ù, ǔ, ü, ǘ, ǜ, ǚ, ǖ, ū, v, w, x, y, and z.
do echo "$f foo bar." ; done |
while read x ; do echo "${x^*}" ; done | head -15 | tail -6
Output:
E, foo bar.
E, foo bar.
É, foo bar.
È, foo bar.
Ě, foo bar.
Ē, foo bar.