Illegal variable name [message #92903] |
Sat, 19 March 2016 23:50  |
Sapna Mishra
Messages: 66 Registered: December 2015
|
Member |
|
|
Hi,
I am using this command in one of my bash script :
l=$(idl -quiet -e "print, n_elements('tmp1')")
its showing error: Illegal variable name.
How ever same script is running on other system.
What could be the reason???
|
|
|
Re: Illegal variable name [message #92906 is a reply to message #92903] |
Sun, 20 March 2016 16:25  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 3/20/16 12:50 AM, Sapna Mishra wrote:
> Hi,
>
> I am using this command in one of my bash script :
>
> l=$(idl -quiet -e "print, n_elements('tmp1')")
>
> its showing error: Illegal variable name.
>
> How ever same script is running on other system.
> What could be the reason???
>
The way this is written, 'tmp1' is a scalar string, so N_ELEMENTS should
always return 1.
In any case, I think "Illegal variable name" is a bash error because IDL
just says "syntax error" when using an invalid variable name:
IDL> print, n_elements(3days)
print, n_elements(3days)
^
% Syntax error.
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
|
|
|