Sample Header Ad - 728x90

bash & zsh friendly process substitution

6 votes
1 answer
233 views
In bash I'm using this common pattern where null-terminated list of process output is processed in a loop, e.g.
declare -a commits
while IFS= read -r -d $'\0' c; do
    commits+=("${c%% *}")
done < <(git log --color=always --pretty=oneline --abbrev-commit --reverse | fzf --tac +s -m -e --ansi --reverse --exit-0 --print0)
Is there a shell-agnostic way to achieve this process substitution, so it'd work both in bash & zsh? Latter hangs with this form.
Asked by laur (790 rep)
Jun 19, 2025, 11:55 AM
Last activity: Jun 20, 2025, 06:29 AM