From a6c5c7ac86817de376dcd4bede961bbe2e5208f2 Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 26 Jul 2007 04:18:41 +0000 Subject: [PATCH] b=12977 r=mjmac r=yujian If anything inside the "while read; do ... done" loop (or it's callees) reads from stdin (a very common thing to do) it will consume input meant for the read since it's reading from stdin with ${CSV_FILE} being redirected to stdin. Read on another file descriptor to avoid this. --- lustre/scripts/lustre_config.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lustre/scripts/lustre_config.in b/lustre/scripts/lustre_config.in index c89dca4..0f849fe 100644 --- a/lustre/scripts/lustre_config.in +++ b/lustre/scripts/lustre_config.in @@ -755,7 +755,8 @@ get_items() { declare -i line_num=0 declare -i idx=0 - while read -r LINE; do + exec 9< ${CSV_FILE} + while read -u 9 -r LINE; do line_num=${line_num}+1 # verbose_output "Parsing line ${line_num}: $LINE" @@ -820,7 +821,7 @@ get_items() { fi idx=${idx}+1 - done < ${CSV_FILE} + done return 0 } -- 1.8.3.1