Re: error using getenv -- bash system

From: <yagnesh_at_nyahnyahspammersnyahnyah>
Date: Sun Jul 14 2013 - 14:43:20 MDT

Hello Ahmad,

On Jul 15 2013, Ahmad Farsyud <a.farsyud@gmail.com> wrote:

> Hallo,
> I want to run my code using shell bash,
> some parameters in the run.sh file are provided as follows:
>
> run.sh
> --------
> #!/bin/bash/

There shouldn't be trailing forward slash. That may be "#!/bin/bash" or even
better "#!/bin/env bash". (Though this doesn't matter in your case since you
executed script by calling "sh" explicitly like "sh run.sh")

> export=mon $2
> export=monstart $2
> export=day $3
> export=daystart $3
> export=avgper 7
> export=year $1
> export=yearstart $1

They are wrong. The syntax for "export" is
export varname=value

with attached modified versions of your script, my shell log is
--8<---------------cut here---------------start------------->8---
$ ./run.sh
 Copyright (C) 1995-2013 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.1.2
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
(0) year: 1
(0) mon: 2
(0) day: 3
(0) avgper: 7
(0) monstart: 2
(0) day: 3
(0) daystart: 3
$
--8<---------------cut here---------------end--------------->8---


PS: I am not sure why you placed dollar signs in the export statement. do you
want give command line arguments to your shell script?

Thanks.,
--
ఎందరో మహానుభావులు అందరికి వందనములు.
YYR

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Sun Jul 14 14:43:20 2013

This archive was generated by hypermail 2.1.8 : Tue Jul 16 2013 - 13:21:17 MDT