I am trying to read all inputs using while loop and print them again, but for some reason doesn't read the final input.. What's going on?
#!/usr/bin/env bash
while read -r num; do
echo $num
done
Input (stdin):
4
1
2
9
8
Output (stdout):
4
1
2
9
# Last input is missing :(
Expected Output:
4
1
2
9
8