From 39597d225451b1d13a2d1a7b3c83060019e799b0 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Sat, 9 Dec 2006 16:02:03 +0000 Subject: [PATCH] Make getFileArray handle multiple files as well. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2420 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- scripts/functions | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/functions b/scripts/functions index 61dbd00..d15cd41 100644 --- a/scripts/functions +++ b/scripts/functions @@ -636,13 +636,17 @@ function getFileValue eval read "$_gfv_var" <"$_gfv_file" } -## Called as 'getFileArray ' +## Called as 'getFileArray +' function getFileArray { - test -r "$2" || return 1 - + local _gfa_var=$1 + local _gfa_file + shift + + findFile _gfa_file "$@" '' + test -n "$_gfa_file" -a -r "$_gfa_file" || return 0 local IFS=$_VS_NEWLINE - eval "$1"='( $(< "$2") )' + eval "$_gfa_var"='( $(< "$_gfa_file") )' } function checkComponents -- 1.8.1.5