title: How to loop script till user input is empty?
body: <p>I am trying to make my script to repeat till the user leaves the block question empty. I just got the loop to run, but I can not find a way to make it possible to stop it when block is empty.</p>
  
  <p>I hope some one can help me!!</p>
  
  <pre><code>#!/bin/tcsh -f
  #
  
  set word="start"
  until ($word !=""); do
  
  #First ask for Compound and Block Name.
  echo -n "please enter block name: "
  read block
  echo -n "please enter compound name: "
  read compound
  
  #Now coping template with new name
  #
  cp Template $block
  #
          for line  in `cat $block`;do
          echo $line | sed -e "s/test1/${block}/g" -e "s/test2/${compound}/g" &gt;&gt;./tmp124.txt
  done
  
  mv ./tmp124.txt $block
  
  done
  </code></pre>