Re: Fwd: Setenv...

From: Rick Grubin (grubin@XXXXXX)
Date: Fri May 16 2003 - 08:21:28 MDT

  • Next message: Qingtao Song: "Re: Fwd: Setenv..."

    Hello Nestor,

    > Date: Wed, 5 Mar 2003 08:27:41 -0500
    > From: Nestor Waldyd <nwaldyd@upb.edu.co>

    > I was trying to use setenv and the bash answers...
    >
    > [waldyd@Aire waldyd]$ setenv NCARG /usr/local/src/ncarg-4.3.1
    > bash: setenv: command not found
    >
    > How can i fix this....?

    The shell bash (Bourne Again SHell) is based on the Unix shell "sh" and
    historically has not supported the setenv command. Setenv is known as a
    "shell builtin" command, meaning it's part of the shell interpreter
    itself, not an external command (like "ls" or similar).

    To accomplish the equivalent of setenv with bash, you'll need to use the
    bash builtin command "declare." Have a look at the manual pages for bash
    and you'll find a section for "SHELL BUILTIN COMMANDS," where declare is
    described fully. Briefly:

      declare -x VAR=value

    will set an environment-wide VAR to value, and

      declare

    will simply list the values of all the VARs that are set for your current
    shell.

    As an example:

    bash-2.05a$ bash --version
    GNU bash, version 2.05a.0(1)-release (i686-pc-linux-gnu)
    Copyright 2001 Free Software Foundation, Inc.

    bash-2.05a$ declare -x NCARG=/usr/local/src/ncarg-4.3.1
    bash-2.05a$ declare | grep NCARG
    NCARG=/usr/local/src/ncarg-4.3.1

    -Rick.

    --
    Rick Grubin                     Visualization + Enabling Technologies
    Scientific Computing Division   National Center for Atmospheric Research   
    grubin@ncar.ucar.edu            303.497.1832
    

    _______________________________________________ ncarg-talk mailing list ncarg-talk@ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncarg-talk



    This archive was generated by hypermail 2b29 : Fri May 16 2003 - 08:12:03 MDT