convert .srtm to xyz ord grd
NOTE: This is not the solution to the question in the title but it solves the problem described in the question's text.

Alternative solution

I would download the netCDF files from the grd directory instead of the srtm files from the data directory on the FTP server. The netCDF files can directly be plotted by GMT.

Example

Based on this file: e020n40.nc

#!/bin/bash

outfile=pic.ps
infile=e020n40.nc
invar=z
colorfile=colors.cpt

gmt makecpt -Cviridis -D -T-5200/2400/400 &gt; ${colorfile}

gmt psbasemap -R20/60/-10/40 -JM18 -B4/4"NSEW" -X+1.5c -P -K &gt; ${outfile}
gmt grdimage ${infile}?${invar} -R -J -C${colorfile} -O -K &gt;&gt; ${outfile}
gmt pscoast -J -R -Di -W1,black -O &gt;&gt; ${outfile}


output (pic.ps imported into GIMP v2.8.22 in 60 dpi resolution and with strong antialiasing):