local ERROR='' !include assignments/Array if [ "$1" = '{' ] then !include map/echoCurlyBlock elif [ "$1" = '[' ] then : elif [ "$1" = '[[' ] then : elif [ "$1" = '{{' ] then : elif [ "$1" = '=~' ] then : elif [ "$1" = '=' ] then : elif [[ "$1" = *'_'* ]] || [[ "$1" = *'$#'* ]] || [[ "$1" =~ \$[0-9] ]] then !include map/singleValue else echo "TODO: ARGUMENT ERROR: $# '$*'" >&2 return 2 fi
Map provided items to given expression.
$@
$1
{
2
ls # => hello.sh world.sh ls | _ map '${_%.sh}' # => hello world
expect "$( echo "$OUTPUT" | cat -e )" toContain 'specHelper$' 'specHelper.sh$''
source $(_ _) # Save results in an array _ map results = _:0:1 "Hello" "World" echo "${#results[@]} results: ${results[*]}" # => "2 results: H W"
expect { example } toEqual "2 results: H W"