Quoting problems in contrib/maint_events.sh

Description

Running this script as distributed results in a pretty nasty pile of barf:

maint_events.sh: line 52: syntax error near unexpected token `('
maint_events.sh: line 52: ` runsql "DELETE FROM events e WHERE e.eventid IN (SELECT o.svcregainedeventid FROM outages o WHERE o.svcregainedeventid IS NOT NULL AND (ifregainedservice - iflostservice)::interval < interval '35 seconds');"'

Turns out to be a quoting problem. If I change out the double quotes around the argument to runsql, replacing them with single quotes (and of course backslash-escaping the single quote characters inside the token) then the script proceeds to the next place where runsql is called with double quotes around its sole token arg.

Environment

Seen in the wild on Oracle Enterprise Linux 5.5 (essentially CentOS 5.5) and on Mac OS X 10.6

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Benjamin Reed May 9, 2011 at 10:17 AM

fixed in 1.8 and master

Fixed

Details

Assignee

Reporter

Labels

Fix versions

Affects versions

Priority

PagerDuty

Created March 24, 2011 at 6:29 PM
Updated January 27, 2017 at 4:21 PM
Resolved May 9, 2011 at 10:17 AM