[GRASS-dev] Documentation glitch

Vaclav Petras wenzeslaus at gmail.com
Fri Nov 30 13:27:03 PST 2018


On Fri, Nov 23, 2018 at 10:32 AM Luí­s Moreira de Sousa <
luis.de.sousa at protonmail.ch> wrote:

>
> I bumped over a glitch with the documentation for r.out.gdal. One of the
> examples is:
> r.out.gdal in=elevation output=elevation.tif type=Float64 \
> createopt="COMPRESS=DEFLATE"
>
> But compression is applied only if the double quotes are left out:
> r.out.gdal in=elevation output=elevation.tif type=Float64 \
> createopt=COMPRESS=DEFLATE
>


Just to follow up on this: Coming to Bash from other languages, this is
little strange, but the quotes are really just for the command line
interpreter. The underlying program does not get them at all which is
actually pretty useful because all quoting is solved by the interpreter and
the underlying program does not need to care about specifics of each
command line. What the underlying programs gets are the
parameters/arguments as they were presented on the command line according
to the rules of that given command line. In Bash & comp. you can try it
with putting echo in front of your command:

echo program "param1" "param2="value2 "param2"=value2 "param2=value2"
param2="value2"

gives

program param1 param2=value2 param2=value2 param2=value2 param2=value2

which what echo actually got.

Also, you have "\ " (backslash space) in your command. That does not have
any meaning there. It is from the documentation where a command was too
long to fit into one line nicely (~72 chars), so the author split it using
line continuation which is a backslash at the end of the line (another Bash
thing).

HTH,
Vaclav

PS: If I recall correctly, I learned about the quotes thing here at the
grass-dev mailing list! :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20181130/c0929dbd/attachment.html>


More information about the grass-dev mailing list