aboutsummaryrefslogtreecommitdiff
path: root/coreutils-5.3.0-bin/share/awk/join.awk
blob: 4a4ac927f52fe01bdf4e44d5e7ee844c45698420 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# join.awk --- join an array into a string
#
# Arnold Robbins, arnold@skeeve.com, Public Domain
# May 1993

function join(array, start, end, sep,    result, i)
{
    if (sep == "")
       sep = " "
    else if (sep == SUBSEP) # magic value
       sep = ""
    result = array[start]
    for (i = start + 1; i <= end; i++)
        result = result sep array[i]
    return result
}