next up previous 526
Next: Groups of Data Files
Up: Specifying Groups of Objects
Previous: Modification

Ignoring Syntax Characters

You can see from the above that several characters have special meanings within group expressions. Examples are ^ | -. This may sometimes cause a problem if you want to include these characters within the strings being passed to the application. For instance, if you want to specify a group of data files using a shell pipe-line, you may want to do something like:

   % display 
     IN - NDF to be displayed > `find . -newer a.fit | grep good `

Within a group expression, the | character indicates a request for a string substitution (as described above). In this case, the GRP library considers the request to be incomplete because there is only one | character, and issues an error report. Of course, the | character was actually intended to indicate that the output from the find command should become the input to the grep command. This can be accomplished by escaping the | character so that its special meaning within the context of a group expression is ignored.

To escape a group expression syntax character, it should be preceded with a backslash ("\"). So the above command should be changed to:

   % display 
     IN - NDF to be displayed > `find . -newer a.fit \| grep good `

Any other special character can be escaped in the same way. For instance, you can escape commas within text strings using this method.



next up previous 526
Next: Groups of Data Files
Up: Specifying Groups of Objects
Previous: Modification

KAPPA --- Kernel Application Package
Starlink User Note 95
Malcolm J. Currie & David S. Berry
2008 September 12
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council