comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » another IDL oddity
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
another IDL oddity [message #65174] Tue, 17 February 2009 07:57 Go to next message
Bringfried Stecklum is currently offline  Bringfried Stecklum
Messages: 75
Registered: January 1996
Member
Folks, here is another one I recently stumbled upon. How about that

more ~/IDL/my_procedure.pro
pro my_procedure,arg
print,arg
end

within IDL
IDL> my_procedure,'Hello.world'
% Compiled module: MY_PROCEDURE.
Hello.world
IDL> exit

from bash
>echo my_procedure,'Hello.world'|idl
IDL Version 6.4 (linux x86_64 m64). (c) 2007, ITT Visual Information Solutions
Installation number: 12207.
Licensed for use by: TLS Tautenburg

% Compiled module: LOADCT.
% Compiled module: FILEPATH.
% Compiled module: PATH_SEP.
% Expression must be a structure in this context: HELLO.
% Execution halted at: $MAIN$

This is just an example. In the real case, the argument is a file name with a
suffix which IDL refuses to treat. The strange thing is that the argument is
checked before the compilation of the procedure. The latter happens indeed

>echo my_procedure|idl
IDL Version 6.4 (linux x86_64 m64). (c) 2007, ITT Visual Information Solutions
Installation number: 12207.
Licensed for use by: TLS Tautenburg

% Compiled module: LOADCT.
% Compiled module: FILEPATH.
% Compiled module: PATH_SEP.
% Compiled module: MY_PROCEDURE.
% PRINT: Variable is undefined: ARG.
% Execution halted at: MY_PROCEDURE 2 /home/stecklum/IDL/my_procedure.pro
% $MAIN$

Any hints?

Regards, Bringfried
Re: another IDL oddity [message #65256 is a reply to message #65174] Wed, 18 February 2009 02:43 Go to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
Bringfried Stecklum wrote:

> jschwab@gmail.com wrote:
>>> Any hints?
>>
>> It's just an artifact of the way that quotes are handled.
>>
>> Compare
>> jschwab: jschwab$ echo my_procedure,'Hello.world'
>> my_procedure,Hello.world
>>
>> to
>>
>> jschwab: jschwab$ echo my_procedure,'"'Hello.world'"'
>> my_procedure,"Hello.world"
>>
>> jschwab: jschwab$ echo my_procedure,"'"Hello.world"'"
>> my_procedure,'Hello.world'
>>
>> jschwab: jschwab$ echo "my_procedure,'Hello.world'"
>> my_procedure,'Hello.world'
>>
>>
>> Josiah
>
> Thanks to all of you for solving this issue. I am a little surprised that the
> call from bash (without the double quote) worked all those years on the old
SuSE
> 8.0 system but does not on Ubuntu 8.1 now. I guess handling quotes is
something
> vital in bash but it seems I overlooked a change of this behavior.
>

I'd be very surprised if anything in bash had changed between SuSE 8 and Ubuntu.
Bash is pretty much enshrined in granite these days. There is a difference,
however, between running those commands interactively and putting them in a
script. In a script the quotes would not have been stripped - this may account
for the difference in behaviour.

--
Nigel Wade
Re: another IDL oddity [message #65267 is a reply to message #65174] Tue, 17 February 2009 11:07 Go to previous message
Bringfried Stecklum is currently offline  Bringfried Stecklum
Messages: 75
Registered: January 1996
Member
jschwab@gmail.com wrote:
>> Any hints?
>
> It's just an artifact of the way that quotes are handled.
>
> Compare
> jschwab: jschwab$ echo my_procedure,'Hello.world'
> my_procedure,Hello.world
>
> to
>
> jschwab: jschwab$ echo my_procedure,'"'Hello.world'"'
> my_procedure,"Hello.world"
>
> jschwab: jschwab$ echo my_procedure,"'"Hello.world"'"
> my_procedure,'Hello.world'
>
> jschwab: jschwab$ echo "my_procedure,'Hello.world'"
> my_procedure,'Hello.world'
>
>
> Josiah

Thanks to all of you for solving this issue. I am a little surprised that the
call from bash (without the double quote) worked all those years on the old SuSE
8.0 system but does not on Ubuntu 8.1 now. I guess handling quotes is something
vital in bash but it seems I overlooked a change of this behavior.

Bringfried
Re: another IDL oddity [message #65270 is a reply to message #65174] Tue, 17 February 2009 08:15 Go to previous message
jschwab@gmail.com is currently offline  jschwab@gmail.com
Messages: 30
Registered: December 2006
Member
> Any hints?

It's just an artifact of the way that quotes are handled.

Compare
jschwab: jschwab$ echo my_procedure,'Hello.world'
my_procedure,Hello.world

to

jschwab: jschwab$ echo my_procedure,'"'Hello.world'"'
my_procedure,"Hello.world"

jschwab: jschwab$ echo my_procedure,"'"Hello.world"'"
my_procedure,'Hello.world'

jschwab: jschwab$ echo "my_procedure,'Hello.world'"
my_procedure,'Hello.world'


Josiah
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: xyouts: define decimal places of variable
Next Topic: Re: How to simplify or mesh a IDLgrLegend Obj ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:40:20 PDT 2025

Total time taken to generate the page: 0.00601 seconds