strace with this code:
#!/usr/bin/env bash exec 0<test.log while IFS= read -r line; do printf "%s\n" "$line" done
<test.log redirection gives the same result.)
I'm getting this error for each read line:
ioctl(0, TCGETS, 0x7fff1e645d50) = -1 ENOTTY (Inappropriate ioctl for device)
I've done some research and this is the nearest answer. It's far from being spot-on though. My script works fine, I'm just wondering if this is something I should deal with or just the standard way of Bash. Isn't it striking that the
ioctl function is called for each line? I had a thought that the
-u parameter to Bash might be related:
-u fd Read input from file descriptor fd.
I've done some experiments to no avail. So how this option is supposed to be used may be another question.
I'm on Ubuntu 16.04 with Bash 4.3.48(1)-release.