#!/bin/zsh

lsof_start="$(lsof -E -p $$ | grep pipe)"

for i in {1..10}; do
    true | true &
    disown
done
sleep 1
lsof_disown="$(lsof -E -p $$ | grep pipe)"

for i in {1..10}; do
    true | true &!
done
sleep 1
lsof_direct="$(lsof -E -p $$ | grep pipe)"

echo 'With the`disown` keyword:'
diff  <(<<<"$lsof_start") <(<<<"$lsof_disown")
echo
echo 'With the `&!` operator:'
diff  <(<<<"$lsof_start") <(<<<"$lsof_direct")
