[Thread Prev][Thread Next][Index]

Re: [ferret_users] Problems with netcdf output and zaxreplace



Hi Ryo,
thanks to your "quote" suggestion I could successfully run my bash script.

Cheers,
Giorgio

----Messaggio originale----
Da: furue@xxxxxxxxxx
Data: 28-apr-2020 14.28
A: "Giorgio Graffino"<g.graffino@xxxxxx>
Cc: "Ferret"<ferret_users@xxxxxxxx>
Ogg: Re: [ferret_users] Problems with netcdf output and zaxreplace

Hi Giorgio,

On Tue, Apr 28, 2020 at 7:09 PM Giorgio Graffino < g.graffino@xxxxxx> wrote:

!-> REPEAT: I=1
**ERROR: command syntax: II = ???
define symbol ii

Compare this line with the one in the original shell script:

ferret << STOP
. . . 
define symbol ii `i`
. . .
STOP

Where did   `i`  go?

In the shell script as well as in the ferret script, the backquote construct is evaluated.  In the above shell script, the shell tries to run a command named "i".  It fails and is replaced with an empty string.  I suppose you saw this error message on your screen

. . . i: command not found

To prevent the shell from interpreting the backquote construct, you "quote" the here-document by

ferret <<'STOP'
. . . 
STOP

Ryo
--------------------
To see what's going on, run this kind of test shell script

echo date
echo `date`
echo "abc `date` def"
echo 'abc `date` def'

cat <<EOF
date
`date`
EOF

cat <<'EOF'
date
`date`
EOF




[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement