# GMT Command not found error in Shell script

**URL:** <https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289>\
**Category:** Q&A\
**Tags:** gmt\
**Created:** [September 20, 2022, 11:55am UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289 "2022-09-20T11:55:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafa\_0110](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/rafa_0110/32/2527_2.png) [@rafa\_0110](https://forum.generic-mapping-tools.org/u/rafa_0110)\
**Post date:** [September 20, 2022, 11:55am UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/1 "2022-09-20T11:55:24Z")

</div>

Hi,

I have installed GMT, and I am trying to run a shell script with GMT commands inside. However, I am getting an error with GMT commands, for example:

makecpt: Command not found, gmtset MEASURE\_UNIT inch  
gmtset: Command not found.  
gmtset PAPER\_MEDIA A4+  
gmtset: Command not found.

I ran in the terminal gmt makecpt … and it works, but when running with the shell script I get the Command not found errors. Someone could help me?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [September 20, 2022, 12:20pm UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/2 "2022-09-20T12:20:26Z")

</div>

You probably need to prepend “gmt” before the commands (in the script)

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 20, 2022, 12:21pm UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/3 "2022-09-20T12:21:21Z")

</div>

Hi Rafa!! Welcome to the GMT forum.

Could you tell us what GMT version do you install, how and in which Operating system?

---

<div class="post-metadata">

**Author:** ![rafa\_0110](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/rafa_0110/32/2527_2.png) [@rafa\_0110](https://forum.generic-mapping-tools.org/u/rafa_0110)\
**Post date:** [September 20, 2022, 12:25pm UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/4 "2022-09-20T12:25:45Z")

</div>

I am using GMT version 6.3.0 on Ubuntu!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [September 20, 2022, 12:44pm UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/5 "2022-09-20T12:44:22Z")

</div>

I suspect that might be an issue related to the path. See this link:

> <https://github.com/GenericMappingTools/gmt/blob/master/BUILDING.md#setting-path>

---

<div class="post-metadata">

**Author:** ![rafa\_0110](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/rafa_0110/32/2527_2.png) [@rafa\_0110](https://forum.generic-mapping-tools.org/u/rafa_0110)\
**Post date:** [September 20, 2022, 1:07pm UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/6 "2022-09-20T13:07:10Z")

</div>

Thank you! I will have a look!!

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [July 19, 2024, 5:50pm UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/8 "2024-07-19T17:50:19Z")

</div>

Instead of revival a 2 years old post, why don’t you create a new one explaining clearly what you did and the error you got?

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [July 19, 2024, 5:54pm UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/9 "2024-07-19T17:54:19Z")

</div>

is this not another bot? it’s this user’s second post in a many month-old thread without any understandable problem description.

empty profile without a single human touch

sure, might be a person, but…

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [July 19, 2024, 6:04pm UTC](https://forum.generic-mapping-tools.org/t/gmt-command-not-found-error-in-shell-script/3289/10 "2024-07-19T18:04:49Z")

</div>

I guess you are right again. I’ve delete this user.
