From 28dcc378781b22ee44363484583812515a4859e3 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 20 Apr 2013 12:45:00 -0400 Subject: functions: return a count of failures from map, if possible I don't have any particular use case for this, but it might be nice to have this available in the future. Signed-off-by: Dave Reisner --- functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions b/functions index 432d700..fac153c 100644 --- a/functions +++ b/functions @@ -193,7 +193,7 @@ die() { map() { local r=0 for _ in "${@:2}"; do - "$1" "$_" || r=1 + "$1" "$_" || (( $# > 255 ? r=1 : ++r )) done return $r } -- cgit v1.2.3-24-g4f1b