# Erro Offending option -R$REGION

**URL:** <https://forum.generic-mapping-tools.org/t/erro-offending-option-r-region/5470>\
**Category:** Q&A\
**Created:** [October 19, 2024, 12:17am UTC](https://forum.generic-mapping-tools.org/t/erro-offending-option-r-region/5470 "2024-10-19T00:17:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navids94](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/navids94/32/4551_2.png) [@Navids94](https://forum.generic-mapping-tools.org/u/Navids94)\
**Post date:** [October 19, 2024, 12:17am UTC](https://forum.generic-mapping-tools.org/t/erro-offending-option-r-region/5470/1 "2024-10-19T00:17:48Z")

</div>

Hello,  
I would like to run the following GMT lines but I got an error when I put lines in cmd:

```auto
#!/bin/sh

gmtset PLOT_DEGREE_FORMAT D
gmtset COLOR_MODEL HSV
gmtset PAPER_MEDIA letter
gmtset PAGE_ORIENTATION portrait
gmtset MEASURE_UNIT inch

# Region will need to be adjusted based on grid values
set REGION = -118.024/-117.508/36.9756/37.2681

set SCALE = 6.0

# These commands are good if you have access to
# a topography database file for the region modeled
# Note: if you uncomment these, adjust the -O -K, etc.
 #######################################################
#grdraster 2 -R$REGION -I0.5m -Gwpp_topo.grd
#grdgradient wpp_topo.grd -Gwpp_topo_shade.grd -A270 -Nt -M
#grd2cpt wpp_topo.grd -Ctopo -Z >! wpptopo.cpt
#grdimage wpp_topo.grd -R$REGION -JM$SCALE -Cwpptopo.cpt -Iwpp_topo_shade.grd -P -K >! plot.ps
 #######################################################
pscoast -R$REGION -JM$SCALE -Bf0.025a0.05 -Dfull -S100,200,255 -A2000 -W3 -N1t3 -N2t2a -K >! plot.ps

# computational grid region...
psxy -R$REGION -JM$SCALE -W10/255/255/0ta -O -K <<EOF>> plot.ps
-118 37
-118 37.2438
-117.533 37.2438
-117.534 37
-118 37
EOF

#SG boundary:
psxy -R$REGION -JM$SCALE -W10/255/255/0ta -O -K <<EOF>> plot.ps
-117.978 37.0172
-117.556 37.0172
-117.555 37.2265
-117.978 37.2265
-117.978 37.0172
EOF

# Sources...
cat << EOF >! event.d
-117.571 37.0287 EVENT-NAME CB
EOF
psxy -R -J -O -K -Sc0.1 -Gred -W0.25p event.d >> plot.ps
awk '{print $1, $2, 12, 1, 9, $4, $3}' event.d | pstext -R -J -O -D0.2/0.2v -Gred -N -K >> plot.ps

# Stations...
cat << EOF >! stations.d
-117.873 37.1859 ALFO1acc CB
-117.873 37.1859 ALFO-1 CB
-117.874 37.1851 ALFO-2 CB
EOF

# plot station names
psxy -R -J -O -K -St0.1 -Gblue -W0.25p stations.d >> plot.ps
awk '{print $1, $2, 12, 1, 9, $4, $3}' stations.d | pstext -R -J -O -Dj0.3/0.3v -Gblue -N >> plot.ps

```

I got following error:

```auto
pscoast [WARNING]: Length <unit> E not supported - revert to default unit [inch]
pscoast [WARNING]: $SCAL not a valid number and may not be decoded properly.
pscoast [ERROR]: Your scale or width ($SCALi) resulted in a zero value.
pscoast [ERROR]: Offending option -JM$SCALE
pscoast [ERROR]: Could not decode $REGION, return NaN.
pscoast [ERROR]: Option -R parsing failure. Correct syntax:
pscoast [ERROR]: Offending option -R$REGION

```

How Can I fix it? thank you so much

---

<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:** [October 19, 2024, 12:41am UTC](https://forum.generic-mapping-tools.org/t/erro-offending-option-r-region/5470/2 "2024-10-19T00:41:27Z")

</div>

`pscoast` errors coming from the variable assignments, wrong syntax for your shell:

```auto
set REGION = -118.024/-117.508/36.9756/37.2681
set SCALE = 6.0

```

the correct syntax:

```auto
REGION=-118.024/-117.508/36.9756/37.2681
SCALE=6.0

```

NB no spaces around `=`

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [October 21, 2024, 7:58am UTC](https://forum.generic-mapping-tools.org/t/erro-offending-option-r-region/5470/3 "2024-10-21T07:58:09Z")

</div>

Hello @Navids94,

welcome to the GMT forum 🙂!

Just formated your script and error / warning messages as code. You can do this by placing three backticks in the line before and after the block with the script:

````auto
```
your script formatted as code
```

````
