|Specsavers County Championship Division Two, SSE Swalec Stadium, day two|
|Glamorgan 220: Selman 101; Miles 4-44, M Taylor 4-56|
|Gloucestershire 347-8: Marshall 101, Payne 58*; Hogan 3-31|
|Glamorgan 3 pts, Gloucestershire 6 pts|
Hamish Marshall's century was the key for Gloucestershire as they took a 127-run first-innings lead over Glamorgan in Cardiff.
New Zealander Marshall lashed 16 boundaries as he shared a fourth-wicket stand of 120 with 19-year-old George Hankins (43).
Michael Hogan struck back with the new ball before Craig Miles (33) and David Payne added 60 for the eighth wicket.
Payne made his third first-class fifty as the visitors closed on 347-8.
Gloucestershire managed to get through the morning session without losing a wicket, as veteran Marshall was particularly harsh on anything loose outside the off stump.
He survived a difficult chance behind the wicket on 40 off Graham Wagg, and reached his 30th first-class century in his final month with the county.
Three wickets fell to the new ball but the visitors' lead looked a significant one thanks to Payne, despite their innings losing its momentum in a drab evening session.
Part of the action was watched by former world heavyweight boxing champion Michael Spinks, who had been invited by Gloucestershire players after a chance meeting in Cardiff.
Glamorgan stand-in captain Michael Hogan told BBC Wales Sport:
"We probably shot ourselves in the foot because we didn't start each session very well and we were trying to get back to evens in that session.
"The consolation is the wicket looks pretty good now, there's no demons so hopefully we can get the last couple of wickets and put up a good total.
"I feel like I've probably been trying to bowl within myself and control the scoring-rate rather than looking for wickets so I've changed a couple of things and hopefully it's right for next year.
"It's a good learning experience (captaining), a few little things I could have done earlier but it's a good challenge, though hopefully Jacques (Rudolph) is back next week."
Gloucestershire batsman Hamish Marshall told BBC Radio Bristol:
"To give their bowlers credit, they bowled well upfront this morning with a bit of swing, we managed to weather that and when you get bowlers into their third and fourth spells it gets a bit tougher (for them).
"They kept coming at us but we batted pretty well today, we're in a strong position and we need to keep trying to push home our advantage, they're not going to roll over.
"I've been here (with Gloucestershire) a long time (since 2006), I'm not over-emotional but I'll miss the lads, playing with them and having a good time with them.
"I love the game but I'll be 38 come next season so it was an opportunity with a young family to look at life outside cricket, I'm going to work with my brother in insurance and I'm looking forward to it."