#!/bin/bash
read -d $'\n' a b c < <(printf '1\n2\n3')
echo $?
printf '[%s]\n' "$a" "$b" "$c"