id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,cpu,platform 2639,grass command should read commands from stdin as an interpreter would do,wenzeslaus,grass-dev@…,"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: {{{ $ python < a = 5 > print(a) > EOF 5 }}} {{{ $ R --vanilla --silent < a = 5 > print(a) [1] 5 > }}} {{{ $ bash < output.txt <: aspect elevation_shade lsat7_2002_70 basin_50K facility lsat7_2002_80 ... elev_state_500m lsat7_2002_61 zipcodes_dbl elevation lsat7_2002_62 ESC[HESC[2J }}} The question is also if there should be the screen cleaning/reset at all; neither Python nor R are using it: {{{ $ $ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type ""help"", ""copyright"", ""credits"" or ""license"" for more information. >>> exit() $ }}} {{{ $ $ R R version 3.0.2 (2013-09-25) -- ""Frisbee Sailing"" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > q() Save workspace image? [y/n/c]: n $ }}} Regarding the welcome text (version, copyright, help, etc.) `python` and `sqlite3` distinguish between interactive invocation (`python`) and input from script or stdin (`python script.py`, `python <