Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix variable question

Re: Unix variable question

From: Jared Still <jkstill_at_cybcon.com>
Date: Tue, 25 Feb 2003 02:29:20 -0800
Message-ID: <F001.00558217.20030225022920@fatcity.com>

It's parameter substitution.

Use the first one if not null, otherwise use the second.

Try this:

> TEST=${ORACLE_HOME:-NOT SET}
> echo $TEST

Now try misspelling ORACLE_HOME

> TEST=${ORACLE_JOME:-NOT SET}
> echo $TEST

In a script you may have to begin the line with a colon.

e.g. : TEST=${ORACLE_HOME:-NOT SET}

Jared

On Tuesday 25 February 2003 01:28, Sinardy Xing wrote:
> Hi all,
>
> Can someone help me understand this...
>
> ROOT # TEST=${2:-.}
> ROOT # echo $TEST
> ROOT #.
>
> what is 2:-.
>
>
> another similar code
>
> ROOT # TEST=${1:-0}
> ROOT # echo $TEST
> ROOT # 0
>
>
>
> they looks like emoticon for me
>
> Thank you
>
> Sinardy

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jared Still
  INET: jkstill_at_cybcon.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Feb 25 2003 - 04:29:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US