Why exit code 141 with grep -q?

前端 未结 3 1628
花落未央
花落未央 2020-12-03 00:59

Can someone explain why I get exit code 141 from the below?

#!/usr/bin/bash

set -o pipefail

zfs list | grep tank
echo a ${PIPESTATUS[@]}

zfs list | grep          


        
3条回答
  •  我在风中等你
    2020-12-03 01:25

    I'm not familiar with zfs list, but I guess it complains about its standard output being closed - grep -q exits immediately when a match is found, unlike grep.

提交回复
热议问题