[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

quoted null character



hello,

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.

take the following code segment -

IDL> ; the variable 'F' is string type result from another procedure
IDL> cmd = 'perl -e '+"'"+'$_ = '+'"'+F+'"'+' ; print if ( m/AC[0-9]{13}.L0/ )'+"'"
IDL> print, cmd
IDL> spawn,cmd,res
IDL> print, res

what is executed by the unix shell is -
perl -e '$_ = "<string>" ; print if ( m/AC[0-9]{13}.L0/ )'

except, when...

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.

anyone?

Thank you, George

-- 
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