next up previous 78
Next: Data files: Internal details
Up: Parameters: Controlling commands
Previous: Output parameters


Syntax conflicts

Some confusion arises from syntax conflicts between the Unix shell and the ADAM parameter system.

An instructive example is where the user wants to find out the value of a certain pixel in an image. In the language of the ADAM parameter system the user is interested in the object `a_file.DATA_ARRAY.DATA(5,7)':

   ICL> hdstrace a_file.DATA_ARRAY.DATA(5,7)

   A_FILE.DATA_ARRAY.DATA(5,7)  <_REAL>
      DATA         152.6
   End of Trace.

Now try the same from the Unix shell:

   % hdstrace a_file.DATA_ARRAY.DATA(5,7)
   Badly placed ()'s.

   % hdstrace a_file.DATA_ARRAY.DATA\(5,7\)

   A_FILE.DATA_ARRAY.DATA(5,7)  <_REAL>
      DATA         152.6
   End of Trace.

As a rule, we have to mask each meta-character with a backslash ($\backslash$). The backslashes make sure the Unix shell passes the meta-characters on and does not interpret them. They then make it through to the ADAM parameter system, and from there the previous arguments apply.

Some people prefer other schemes such as enclosing the whole object specification in a pair of single quotes or double quotes. The advantage is that you need only two additional characters no matter how many pairs of parentheses are in the object name. The disadvantage is that you need a matching pair of characters, and that sometimes you need to pass quotes to the ADAM parameter system.

The troublesome meta-characters are parentheses (), square brackets [], quotes ', double quotes " and the backslash itself. See SC/4 for further details.



next up previous 78
Next: Data files: Internal details
Up: Parameters: Controlling commands
Previous: Output parameters

FIGARO A general data reduction system
Starlink User Note 86
Keith Shortridge, Horst Meyerdierks,
Malcolm Currie, Martin Clayton, Jon Lockley,
Anne Charles, Clive Davenhall,
Mark Taylor, Tim Ash, Tim Wilkins, Dave Axon,
John Palmer, Anthony Holloway and
Vito Graffagnino
2004 February 17
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council