Loading ...
Sorry, an error occurred while loading the content.
 

When Quotes Attack

Expand Messages
  • Shlomi Fish
    I blissfully wrote the following lines in a bash script that served as a test suite for Quad-Pres: for lang1 in he-IL ; do for char1 in utf-8 ; do
    Message 1 of 1 , Oct 11 1:52 PM
      I blissfully wrote the following lines in a bash script that served as
      a test suite for Quad-Pres:

      for lang1 in "" "he-IL" ; do
      for char1 in "" "utf-8" ; do
      for lang2 in "" "en-GB" ; do
      for char2 in "" "iso-8859-8" ; do
      perform_test $lang1 $char1 $lang2 $char2
      done
      done
      done
      done

      Where perform_test is a function that takes 4 arguments. And then it did
      not work properly, and I banged my head on the wall trying to find out
      why?

      Can you spot the bug?

      The problem is that if unquoted the variables expand into the empty string
      and a command line containing this does not treat them as a distinct
      argument. (rather as an empty space). Adding quotes around each argument
      solved the problem.

      You can find the complete (now working code) here:

      http://stalker.iguide.co.il:8080/svn/lm-solve/quad-pres/trunk/installer/tests/

      Regards,

      Shlomi Fish

      $There $is $No IGLU Cabal!


      ----------------------------------------------------------------------
      Shlomi Fish shlomif@...
      Home Page: http://t2.technion.ac.il/~shlomif/

      An apple a day will keep a doctor away. Two apples a day will keep two
      doctors away.

      Falk Fish
    Your message has been successfully submitted and would be delivered to recipients shortly.