dotfiles/.vim/bash-support/codesnippets/use-file-descriptor-write

14 lines
278 B
Plaintext
Raw Permalink Normal View History

2019-10-20 16:24:07 -05:00
outfilename="" # output filename
exec 4>"$outfilename"
if [ $? -ne 0 ] ; then
echo -e "Could not link file descriptor with file '$outfilename'\n"
exit 1
fi
echo -e "text" >&4
exec 4>&- # close file descriptor