# Gmt \[ERROR\]: Cannot run a one-liner modern command within an existing modern mode session

**URL:** <https://forum.generic-mapping-tools.org/t/gmt-error-cannot-run-a-one-liner-modern-command-within-an-existing-modern-mode-session/2268>\
**Category:** Q&A\
**Tags:** gmt\
**Created:** [November 6, 2021, 10:00am UTC](https://forum.generic-mapping-tools.org/t/gmt-error-cannot-run-a-one-liner-modern-command-within-an-existing-modern-mode-session/2268 "2021-11-06T10:00:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucacastro95](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lucacastro95](https://forum.generic-mapping-tools.org/u/lucacastro95)\
**Post date:** [November 6, 2021, 10:00am UTC](https://forum.generic-mapping-tools.org/t/gmt-error-cannot-run-a-one-liner-modern-command-within-an-existing-modern-mode-session/2268/1 "2021-11-06T10:00:22Z")

</div>

Hello everyone!

I’m new on gmt and I am attending the well-done tutorial released by gmt self. Despite all, I am having some issues working on my script.

 ![issue1](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/e/e4851379278748c9f4efe299c97b80bfa47c3d89.png)

I’m trying to run these commands but if I add the option -png gulf\_of\_mexico the png file won’t be created, instead it will return me an error message like the one below:

![issue2](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/e/eecaaa9348e8554776a52605b889f722d02236ec.png)

I tried not to use the option -png gulf\_of\_mexico and it works well but it does not show the output. In the same way, if I try running the two commands separately the script works well. It seems that gmt grimage and gmt coast cannot lay together in a single png file.  
I specify I’m working with a .bat file.

I hope some of you could help me. Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![lucacastro95](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lucacastro95](https://forum.generic-mapping-tools.org/u/lucacastro95)\
**Post date:** [November 6, 2021, 11:15am UTC](https://forum.generic-mapping-tools.org/t/gmt-error-cannot-run-a-one-liner-modern-command-within-an-existing-modern-mode-session/2268/2 "2021-11-06T11:15:51Z")

</div>

Okay guys, I found out the issue. It was necessary to write ‘gmt end show’, not just “gmt end”.
