Message3683

Author otmarhumbel
Recipients foripperz, fwierzbicki, mr_tines, otmarhumbel
Date 2008-10-14.12:39:36
SpamBayes Score 1.5029242e-06
Marked as misclassified No
Message-id <1223987976.45.0.633946563445.issue1125@psf.upfronthosting.co.za>
In-reply-to
Content
The attached test_empty.bat allows quoted and unquoted strings to be
tested for emptiness.
The output is as follows:

  C:\stuff\temp>test_empty.bat

  ["my home 1"] was set: 1
  command: ["my home 1\bin\java"]

  [my home 2] was set: 1
  command: ["my home 2\bin\java"]

  [""] was set: 0
  command: [java]

  [] was set: 0
  command: [java]

  [] was set: 0
  command: [java]

  ["myhome6"] was set: 1
  command: ["myhome6\bin\java"]

  [myhome7] was set: 1
  command: ["myhome7\bin\java"]


  Legend: 1 = the variable is set,
          0 = it is not set


The key line is the for loop:
  for /f "useback tokens=*" %%a in ('%_TRIMMED_VAR%') do set
_TRIMMED_VAR=%%~a

, which should be applicable to jython.bat as well.
History
Date User Action Args
2008-10-14 12:39:36otmarhumbelsetmessageid: <1223987976.45.0.633946563445.issue1125@psf.upfronthosting.co.za>
2008-10-14 12:39:36otmarhumbelsetrecipients: + otmarhumbel, fwierzbicki, mr_tines, foripperz
2008-10-14 12:39:36otmarhumbellinkissue1125 messages
2008-10-14 12:39:36otmarhumbelcreate