title: How to grep a string in until loop in bash?
body: <p>I work on a script compressing files. I want to do an 'until loop' til' the content of variable matches the pattern. The script is using zenity. This is the major part:</p>
  
  <pre><code>part="0"
  pattern="^([0-9]{1}[0-9]*([km])$"
  until `grep -E "$pattern" "$part"` ; do
      part=$(zenity --entry \
      --title="Zip the file" \
      --text "Choose the size of divided parts:
  (0 = no division, *m = *mb, *k = *kb)" \
      --entry-text "0");
  
      if grep -E "$pattern" "$part" ; then
          zenity --warning --text "Wrong text entry, try again." --no-cancel;
      fi
  done
  </code></pre>
  
  <p>I want it to accept string containing digits ended with 'k' or 'm' (but not both of them) and don't accept string started with '0'.</p>
  
  <p>Is the pattern ok?</p>