Write to and read from file descriptors in awk
by blueray from LinuxQuestions.org on (#6DC2P)
I am trying to write to one file descriptor and then read the output from another file descriptor in awk.
Code:#!/usr/bin/env bash
coproc get_icon_from_path_stdin
exec 10>&"${COPROC[1]}"
exec 11<&"${COPROC[0]}"
awk '{ print $0 > /dev/fd/10
getline result < /dev/fd/11
print result }' $HOME/.dotfiles/rofi-bookmarks-listHere `result` returning null values.
Not understanding the problem here.
Code:#!/usr/bin/env bash
coproc get_icon_from_path_stdin
exec 10>&"${COPROC[1]}"
exec 11<&"${COPROC[0]}"
awk '{ print $0 > /dev/fd/10
getline result < /dev/fd/11
print result }' $HOME/.dotfiles/rofi-bookmarks-listHere `result` returning null values.
Not understanding the problem here.