I can open a file descriptor explicitly the normal way:$ ls -lh /dev/fd/total 0lrwx------ 1 tavianator users 64 Jul 10 11:06 0 -> /dev/pts/6lrwx------ 1 tavianator users 64 Jul 10 11:06 1 -> /dev/pts/6lrwx------ 1 tavianator users 64 Jul 10 11:06 2 -> /dev/pts/6lr-x------ 1 tavianator users 64 Jul 10 11:06 3 -> /proc/31288/fd$ exec 3<foo$ ls -lh /dev/fd/total 0lrwx------ 1 tavianator users 64 Jul 10 11:07 0 -> /dev/pts/6lrwx------ 1 tavianator users 64 Jul 10 11:07 1 -> /dev/pts/6lrwx------ 1 tavianator users 64 Jul 10 11:07 2 -> /dev/pts/6lr-x------ 1 tavianator users 64 Jul 10 11:07 3 -> /home/tavianator/foolr-x------ 1 tavianator users 64 Jul 10 11:07 4 -> /proc/31334/fdSo far so good.  zsh doesn't seem to support two-digit file descriptor syntax like 10<foo, but it does support a variable substitution syntax {fd}<foo:$ fd=10$ exec {fd}<foo$ ls -lh /dev/fd/total 0lrwx------ 1 tavianator users 64 Jul 10 11:08 0 -> /dev/pts/6lrwx------ 1 tavianator users 64 Jul 10 11:08 1 -> /dev/pts/6lr-x------ 1 tavianator users 64 Jul 10 11:08 11 -> /home/tavianator/foolrwx------ 1 tavianator users 64 Jul 10 11:08 2 -> /dev/pts/6lr-x------ 1 tavianator users 64 Jul 10 11:08 3 -> /home/tavianator/foolr-x------ 1 tavianator users 64 Jul 10 11:08 4 -> /proc/31413/fdBut hold on, why is fd 11 open instead of 10?
Why does zsh open a file descriptor off by one?
shell;zsh;file descriptors