ccase
ccase copied to clipboard
ccase should not read stdin unless instructed
Using ccase in a while loop I noticed that it is not only coverting the value passed on the command line, but also all the standard input.
printf "a\nb\nc\n" | while read word; do
U="$(ccase --to upper "${word}")";
echo converted: $U
done
Should print:
converted: A
converted: B
converted: C
Instead it prints:
converted: A
B
C
Indicating that the loop iterated only one time.
A workaround is to give it null stdin:
printf "a\nb\nc\n" | while read word; do
U="$(ccase --to upper "${word}" < /dev/null)";
echo converted: $U
done