another IDL oddity [message #65174] |
Tue, 17 February 2009 07:57  |
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  |
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  |
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  |
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
|
|
|