OILS / benchmarks / compute / word_split.sh View on Github | oilshell.org

24 lines, 12 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# benchmarks/compute/word_split.sh <function name>
5
6count_argv() {
7 echo "COUNT = $#"
8}
9
10default_ifs() {
11 local filename=$1
12
13 count_argv $(cat $filename)
14}
15
16other_ifs() {
17 local filename=$1
18
19 # whitespace and non-whitespace
20 export IFS=',: '
21 count_argv $(cat $filename)
22}
23
24"$@"