GMT 5.4.4 Append not working in Linux

I’m new GMTuser. Running gmt in CentOS Linux

I’m following the tutorial for GMT5.4.4
Tutorial Link
I prepared the script with this command from the tutorial.

gmt psxy @y.txt -R0/6/0/6 -Jx1i -Baf -P -K -Wthinner >
gmt psxy y.txt -R -J -O -W -Si0.2i >>

y.txt is below
1 1
2 3
2 5
3 2
4 4
5 2

I keep on getting two files with same name but the other has question mark in the end


both the files didn’t show the expected result.
but when I run the command per line it’s working. But whenever I try to append new command to the existing figure I get a file with a question mark at the end.

I would like to make multiple lines of command but 2lines of command is not working in my environment, I can’t figure out
do you have an idea how to solve this?

Hi EQlab!! Welcome to the GMT forum.

I don’t anything weird in your commands. Maybe the @ in @y.txt.

What GMT version are you using? The latest version is 6.2. If you can, I would suggest you to use 6.2 and use the modern syntax, If is much simpler.

1 Like

Hi! Thank you for your reply. I am using a laboratory server with newly installed gmt5.4.4 version. I don’t have access to the installation option on the server. But I will consider that if I cant find a solution

Thank you for your help

You are welcome. I suspect an issue server. If I were you, I will try to find the way to upgrade GMT. If you want to learn GMT, it is not good to learn and old version (5.4.4 is from sep-2018). Maybe you can try it online?

1 Like

Not that it’s a “good” workaround, but you likely can use your own install on the server with conda (or miniconda).

conda create -n gmt
source activate gmt
conda install gmt=5.4.4 --channel conda-forge

assuming you actually have conda…

1 Like

Are you writing a file with the set of GMT commands and trying to run that? How are you running it?

1 Like

The questionmark etc makes we wonder if you are using a rich-text editor to make those script and run them. Such files will have formatting hidden characters and that would explain the troubles.

1 Like

yes. I write the commands in a notepad using Windows PC, then saved it with a .sh file format. Then, transfer the file to the server and run it in server terminal using “bash”.

Thank you! This might be the issue. I used the built-in notepad on Windows PC, I also try Notepad++ to prepare the .sh file. What program should I use to prepare the .sh file?

NotePad++ might work, or Visual STudio Code.

1 Like

Thank you Sir. I’m using Notepad++ now. I will try the Visual Studio Code. Thank you again! It really helps to have this forum

I have not used Windows PC editors much, but it is always safer to write Linux scripts using a Linux editor such as “vi” to avoid any special characters being included. On the Mac, there is usually an option to “save as plain text” that removes most special formatting.

1 Like

Issue is solved. I used Sakura Editor to prepare scripts and textfiles. Thank you all for your help!!