From: brian Date: Thu, 26 Jul 2007 04:18:41 +0000 (+0000) Subject: b=12977 X-Git-Tag: v1_8_0_110~1420 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=a6c5c7ac86817de376dcd4bede961bbe2e5208f2;p=fs%2Flustre-release.git 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. --- 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 }