Opened 8 years ago

Closed 5 years ago

#2872 closed defect (worksforme)

"r.info -e" output not compliant with eval

Reported by: andbal Owned by: grass-dev@…
Priority: normal Milestone: 7.0.7
Component: Shell Scripts Version: svn-trunk
Keywords: shell, r.info Cc:
CPU: x86-64 Platform: Linux

Description

I've got an error using the command eval `r.info -e <map_name>`. This is the output:

GRASS 7.1.svn (---):~ > eval `r.info -e map=soilheatflux.dos4`
bash: unexpected EOF while looking for matching `"'
bash: syntax error: unexpected end of file

The error is likely to be correlated to the flags -e because with other flag (like -r for example), the command eval works well.

Change History (8)

comment:1 by andbal, 8 years ago

I add the output of r.info -e executed outside eval

GRASS 7.1.svn (L5_Papk):~ > r.info -e map=soilheatflux.dos4 
map=soilheatflux.dos4
mapset=L5
location=L5_Papk
database=/home/andrea/GIS-software-data/GRASS-data
date="Thu Jan 21 09:06:28 2016"
creator="andrea"
title=" (soilheatflux.dos4)"
timestamp="none"
units="none"
vdatum="none"
source1=""
source2=""
description="generato da i.eb.soilheatflux"
comments="i.eb.soilheatflux albedo="albedo.dos4" ndvi="ndvi.dos4" temperature=\"toa_temp.6" netradiation="rad.M1" localutctime="overpass_utc" outpu\t="soilheatflux.dos4""

Another person suggest me that maybe is a quotes problem in the comments field.

in reply to:  1 comment:2 by neteler, 8 years ago

Milestone: 7.0.3

Replying to andbal:

I add the output of r.info -e executed outside eval

...
comments="i.eb.soilheatflux albedo="albedo.dos4" ndvi="ndvi.dos4" temperature=\"toa_temp.6" netradiation="rad.M1" localutctime="overpass_utc" outpu\t="soilheatflux.dos4""

The issue is that the inner quotes " need to be escaped when fprintf'ing the comment:

https://trac.osgeo.org/grass/browser/grass/trunk/raster/r.info/main.c#L392

I suppose that there is already a function for that?

comment:3 by neteler, 8 years ago

Milestone: 7.0.3

Ticket retargeted after milestone closed

comment:4 by neteler, 8 years ago

Milestone: 7.0.4

Ticket retargeted after 7.0.3 milestone closed

comment:5 by martinl, 8 years ago

Milestone: 7.0.47.0.5

comment:6 by neteler, 8 years ago

Milestone: 7.0.57.0.6

comment:7 by neteler, 6 years ago

Milestone: 7.0.67.0.7

comment:8 by martinl, 5 years ago

Resolution: worksforme
Status: newclosed

Unable to reproduce with GRASS 7.6.0.

Note: See TracTickets for help on using tickets.