[GRASS-SVN] r30484 - grass/trunk/general/g.message

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Mar 6 01:33:34 EST 2008


Author: hamish
Date: 2008-03-06 01:33:34 -0500 (Thu, 06 Mar 2008)
New Revision: 30484

Modified:
   grass/trunk/general/g.message/description.html
Log:
better explaination from Ivan, with a few edits of my own

Modified: grass/trunk/general/g.message/description.html
===================================================================
--- grass/trunk/general/g.message/description.html	2008-03-06 06:21:44 UTC (rev 30483)
+++ grass/trunk/general/g.message/description.html	2008-03-06 06:33:34 UTC (rev 30484)
@@ -19,11 +19,6 @@
 Messages containing "<tt>=</tt>" must use the full <b>message=</b> syntax so
 the parser doesn't get confused.
 <P>
-Messages containing '<tt>!</tt>' and '<tt>$</tt>' must use single 'quotes' to
-avoid unwanted shell translation. (Apparently '!' will not be expanded if
-double-quoted in a non-interactive shell (i.e. a script), but it is probably
-worth single-quoting it anyway to avoid contex based confusion later on)
-<P>
 If you want a long message (mutli-line) to be dealt with as a single
 paragraph, use a single call to <em>g.message</em> with text split in the
 script using the backslash as the last character. (In shell scripts don't
@@ -33,6 +28,21 @@
 <P>
 Redundant whitespace will be stripped away.
 <P>
+It's advisable to single quote the messages that are to be printed literally.
+It prevents a number of characters (most notably, space and the dollar sign
+'<tt>$</tt>') from being treated specifically by the Shell.
+<P>
+When it is necessary to include, for example, a variable's value as part of
+the message, the double quotes may be used, which do not deprive the
+dollar sign of its special variable-expansion powers.
+<P>
+While it is known that the interactive Bash instances may treat the
+exclamation mark '<tt>!</tt>' character specifically (making single quoting
+of it necessary), it shouldn't be the case for the non-interactive
+instances of Bash. None the less, to avoid context-based confusion later on
+you are enouraged to single-quote messages that do not require
+<tt>$VARIABLE</tt> expansion.
+<P>
 
 <h4>VERBOSITY LEVELS</h4>
 Controlled by the "<tt>GRASS_VERBOSE</tt>" environment variable. Typically this



More information about the grass-commit mailing list