I wrote a simple script whichthat echo-es its own PID every half a second:
#/bin/bashsh while true; do echo $$;$$ sleep 0.5;5 done I'm running said script (it says 3844 over and over) in one terminal and trying to tail the file descriptor in another one:
$ tail -f /proc/3844/fd/1 It doesn't print anything to the screen and hangs until ^c. Why?
Also, all of the STD file descriptors (IN/OUT/ERR) link to the same pts:
$ ls -l /proc/3844/fd/ total 0 lrwx------ 1 mg mg 64 sie 29 13:42 0 -> /dev/pts/14 lrwx------ 1 mg mg 64 sie 29 13:42 1 -> /dev/pts/14 lrwx------ 1 mg mg 64 sie 29 13:42 2 -> /dev/pts/14 lr-x------ 1 mg mg 64 sie 29 13:42 254 -> /home/user/test.sh lrwx------ 1 mg mg 64 sie 29 13:42 255 -> /dev/pts/14 Is this normal?
Running Ubuntu GNOME 14.04.
If you think this question belongs to SO or SU instead of UL, do tell.