quoted null character [message #19087] |
Thu, 24 February 2000 00:00 |
George McCabe
Messages: 23 Registered: June 1997
|
Junior Member |
|
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
hello,
<p>i had one hell of a time today figuring out some unexpected results
in IDL string processing, and i wonder of any one has encountered similar
problems.
<p>take the following code segment -
<p>IDL> ; the variable 'F' is string type result from another procedure
<br>IDL> cmd = 'perl -e '+"'"+'$_ = '+'"'+F+'"'+' ; print if ( m/AC[0-9]{13}.L0/
)'+"'"
<br>IDL> print, cmd
<br>IDL> spawn,cmd,res
<br>IDL> print, res
<p>what is executed by the unix shell is -
<br>perl -e '$_ = "<string>" ; print if ( m/AC[0-9]{13}.L0/ )'
<p>except, when...
<p>in case when the string in variable 'F' ends in a null character.
then one gets an incomplete concatenation beyond the null. since
i'ld already spent an hour or so rearranging quote marks and parting up
the process to find the problem, i didn't spend time after discovering
the cause to figure out if IDL was interpreting the null as a quote
or other weird possibilities.
<p>anyone?
<p>Thank you, George
<pre>--
George McCabe (Raytheon ITSS)
NASA / Goddard Space Flight Center / Code 693 / Greenbelt, MD
voice: (301)286-8283, fax: (301)286-0212
george.mccabe@gsfc.nasa.gov</pre>
</html>
|
|
|