[ncl-talk] run ncl script in bash file [SEC=UNCLASSIFIED]

Griffith Young G.Young at bom.gov.au
Mon Apr 20 17:50:43 MDT 2015


Hello Tony,
	There are multiple reasons that you will not get the result you want from a bash file.

	I would suggest that you tackle the problem in small steps.

	Running the command "which ncl" will tell you which ncl program you are running.  It could be that the command line is not running the ncl command in your home directory, but some other correctly installed ncl program elsewhere.

	Running your bash script on the command line should determine if you are able to run the script itself.
		./roms_5_ratio.bash     # I am guessing your script name.

	Assuming that this runs, then there is the potential issue of the environment for your script.  If you are running this script through "cron", your environment may/will be different to your command line environment.  This is hinted to me by the fact that you have exported the NCL environment variable in your script.  You will need to ensure that all the NCL environment variables are setup correctly if you are running from "cron".

	These are my common issues with trying to run NCL in a script.  I hope this helps.

Regards,
	Griff.


----------------------------------------------------------------------

Message: 1
Date: Mon, 20 Apr 2015 10:29:57 +0800
From: Guiting Song <guitingsong at gmail.com>
Subject: [ncl-talk] run ncl script in bash file
To: ncl-talk at ucar.edu
Message-ID:
	<CAJy6Gbmz3qfuH-Perzq-8MJGVAEqsRovK5AwCFZVw4hvV=Askg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi, All,

I can run my ncl script-roms_5_ratio.ncl in linux command line. But can not
make it in bash file. My bash file is like below

_______________________________________________________________
#!/bin/bash

export NCL=/home/arnold/software/ncl_ncarg/bin/ncl
$NCL
/home/arnold/ROMS_AGRIF_Vietnam/Roms_tools/Run/FORECAST/roms_5_ratio.ncl >
ncl.log

_____________________________________________________________

however it does not give me the running result, does anybody have
experiences about how to run ncl scripts in bash file, please share with me
and I will be very appreciated.

Best regards,
Tony


More information about the ncl-talk mailing list