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

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

AW: Unix variable question

From: Kulev, Milen <Milen.Kulev_at_BusinessMart.de>
Date: Tue, 25 Feb 2003 02:23:48 -0800
Message-ID: <F001.005581A6.20030225022348@fatcity.com>


Answer1: ROOT # man bash
Answer2(copy& paste form answer1)


      ${parameter}
              The value of parameter is substituted.  The braces are
required  when  parameter  is  a  positional
              parameter with more than one digit, or when parameter is
followed by a character which is not to be
              interpreted as part of its name.

       If the first character of parameter is an exclamation point, a level
of  variable  indirection  is  intro­
       duced.  Bash uses the value of the variable formed from the rest of
parameter as the name of the variable;
       this variable is then expanded and that value is used in the rest of
the  substitution,  rather  than  the
       value  of  parameter itself.  This is known as indirect expansion.
The exception to this is the expansion
       of ${!prefix*} described below.

       In each of the cases below, word is subject to tilde expansion,
parameter expansion, command substitution,
       and  arithmetic  expansion.   When  not performing substring
expansion, bash tests for a parameter that is
       unset or null; omitting the colon results in a test only for a
parameter that is unset.
       ${parameter:-word}
              Use Default Values.  If parameter is unset or null, the
expansion of word is  substituted.   Other­
              wise, the value of parameter is substituted.
       ${parameter:=word}
              Assign Default Values.  If parameter is unset or null, the
expansion of word is assigned to parame­
              ter.  The value of parameter is then substituted.  Positional
parameters and special parameters may
              not be assigned to in this way.
------------------------------------------------
Milen

-----Ursprüngliche Nachricht-----
Von: Sinardy Xing [mailto:SinardyXing_at_bkgcomsvc.com] Gesendet: Dienstag, 25. Februar 2003 10:29 An: Multiple recipients of list ORACLE-L Betreff: Unix variable question

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: Sinardy Xing
  INET: SinardyXing_at_bkgcomsvc.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).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Kulev, Milen
  INET: Milen.Kulev_at_BusinessMart.de

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:23:48 CST

Original text of this message

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