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

Home » Public Forums » archive » Illegal variable name
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
Illegal variable name [message #92903] Sat, 19 March 2016 23:50 Go to next message
Sapna Mishra is currently offline  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 Go to previous message
Michael Galloy is currently offline  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)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: error in cgWindRose code
Next Topic: Re: Apply a shapefile to raster images in IDL

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

Current Time: Wed Oct 08 09:14:08 PDT 2025

Total time taken to generate the page: 0.00453 seconds