Open landam opened 5 years ago
Comment by neteler on 5 May 2016 14:08 UTC Milestone renamed
Comment by neteler on 28 Dec 2016 15:04 UTC Ticket retargeted after milestone closed
Modified by @landam on 5 May 2017 20:40 UTC
Comment by @landam on 1 Sep 2017 20:28 UTC All enhancement tickets should be assigned to 7.4 milestone.
Comment by neteler on 26 Jan 2018 11:40 UTC Ticket retargeted after milestone closed
Modified by neteler on 12 Jun 2018 20:48 UTC
Modified by wenzeslaus on 17 Sep 2018 03:25 UTC
Reported by wenzeslaus on 2 Apr 2015 16:02 UTC GRASS GIS works as something between set of command line tools (e.g. GDAL, or POSIX utilities) and an interpreter with unique commands or syntax (Python, R). However, GRASS GIS does not behave as the former because the tools are not available in standard command line (system environment). Unfortunately,
grass
(grass7
) command does not behave as an interpreter neither because it does not allow scripts to be executed in the same way as with the standard interpreters.Standard interpreters allow to provide commands/script as standard input:
grass
actually allows to do the same and the commands are executed.However, the behavior is significantly different from standard interpreters: screen is reset and a lot of other text is printed. To see what is happening, we can redirect stdout to a file.
The following standard error output is shown in the command line:
Output file as displayed by
less output.txt
contains characters to reset/clean the terminal:The question is also if there should be the screen cleaning/reset at all; neither Python nor R are using it:
Regarding the welcome text (version, copyright, help, etc.)
python
andsqlite3
distinguish between interactive invocation (python
) and input from script or stdin (python script.py
,python <<EOF
) and don't show anything in later case.With
R
we need to use--silent
to suppress the welcome text but it actually checks the type of interaction too and requires additional parameters (e.g.--vanilla
) when running in non-interactive mode. It must be noted that R hasRscript
which is dedicated to running R scripts but it does not support input from stdin.= What should be enhanced =
When standard (non-interactive) input is provided or a specific command line option set,
grass
command should not perform cleaning of the terminal and perhaps should be less verbose.This is of course partially overlapping with https://trac.osgeo.org/grass/ticket/2579 but it is an important use case which we should take care of explicitly. Perhaps this behavior can be activated when the
grass batch
/grass exec
/grass run
/grass script
/grass --batch
syntax is used.Migrated-From: https://trac.osgeo.org/grass/ticket/2639