Adding upstream version 5.2.37.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
parent
cf91100bce
commit
fa1b3d3922
1435 changed files with 757174 additions and 0 deletions
15
examples/functions/array-to-string
Normal file
15
examples/functions/array-to-string
Normal file
|
@ -0,0 +1,15 @@
|
|||
#! /bin/bash
|
||||
|
||||
# Format: array_to_string vname_of_array vname_of_string separator
|
||||
array_to_string()
|
||||
{
|
||||
(( ($# < 2) || ($# > 3) )) && {
|
||||
"$FUNCNAME: usage: $FUNCNAME arrayname stringname [separator]"
|
||||
return 2
|
||||
}
|
||||
|
||||
local array=$1 string=$2
|
||||
((3==$#)) && [[ $3 = ? ]] && local IFS="${3}${IFS}"
|
||||
eval $string="\"\${$array[*]}\""
|
||||
return 0
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue