grass command welcomes batch job and requires user input
|Reported by:||wenzeslaus||Owned by:|
|Keywords:||GRASS_BATCH_JOB, rc file, init, startup||Cc:|
When calling GRASS GIS to do a batch job without having rc file created, one gets:
WELCOME TO GRASS Version 6.4.4 2014 ... - Current catalog of available computer maps ... Hit RETURN to continue
This warm welcome is intended for user but when a GRASS_BATCH_JOB is set, this should not be executed because there is usually nobody to hit RETURN since the process is executed from some program.
cat > test_script.sh <<EOF echo "Hello from GRASS GIS" > test_file.txt date >> test_file.txt EOF
rm ~/.grassrc6 grass64 ~/grassdata/nc_spm_08_grass7_tests/user1
Here is a patch which works for me for version 6.4:
421 421 fi 422 422 423 423 # First time user - GISRC is defined in the GRASS script 424 if [ ! -f "$GISRC" ] ; then 424 if [ ! -f "$GISRC" ] ; then 425 425 426 426 if [ ! -f "$GISBASE/locale/$LCL/etc/grass_intro" ] ; then 427 427 cat "$ETC/grass_intro"
I'm not sure if it is correctly implemented because it causes that the rc file (
~/.grassrc6) is not created (using the
<UNKNOWN>). It does not seem useful anyway but I guess that there is some reason for it.
Basically the same patch can be applied to version 7. Check
batch_job) before calling
grass_intro(). I'm just don't have the full understanding of the code, for example I'm not sure how rc file is supposed to be handled with
A workaround for version 6.4 is to create a
.grassrc6 file in directory specified by
$HOME with some reasonable content (e.g. a copy of existing
.grassrc6 from different user).