Hi,
Why does the following not work?
exec 3<|cat $0
The idea is to get file-descriptor (3) of a pipe (| cat $0).
Hi,
Why does the following not work?
exec 3<|cat $0
The idea is to get file-descriptor (3) of a pipe (| cat $0).
You cannot mix exec and pipes that way. It seems what you need is a process substitution:
$ exec 3< <(cat /etc/hosts)
$ grep ftp <&3
209.85.41.143 ftp.archlinux.org