Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Bash: read inside while loop
  2. NUM_LINE=0
  3. while read line; do
  4.   let NUM_LINE+=1
  5.   if [ $NUM_LINE -lt 41 ]; then
  6.     echo -e "t$BLANC|$ORIGINAL $line $BLANC|"
  7.   else
  8.     echo -e "nt$BLANC## "$GRIS"Llista de Nodes sel·leccionats    $BLANC############$ORIGINALn"
  9.     read AUX
  10.     NUM_LINE=0  
  11.   fi
  12. done <$NODES
  13.        
  14. exec 3<$NODES
  15. NUM_LINE=0
  16. while read -u 3 -r line; do
  17.   (( NUM_LINE++ ))
  18.   if (( NUM_LINE < 41 )); then
  19.     echo -e "t$BLANC|$ORIGINAL $line $BLANC|"
  20.   else
  21.     echo -e "nt$BLANC## "$GRIS"Llista de Nodes sel·leccionats    $BLANC############$ORIGINALn"
  22.     read AUX
  23.     NUM_LINE=0  
  24.   fi
  25. done