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
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. :
Nachricht-
Von: Sinardy Xing [mailto:[EMAIL PROTECTED]
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
Hello Sinardy,
Tuesday, February 25, 2003, 3:28:42 PM, you wrote:
SX Hi all,
SX Can someone help me understand this...
SX ROOT # TEST=${2:-.}
SX ROOT # echo $TEST
SX ROOT #.
SX what is 2:-.
The construction ${A:-B} is just like oracle nvl function. If variable
A is defined and not null then
look into man page eg bash or sh and search for ${ (is type in /\$\{ )
and find all necessary details.
lol
Apologies for any typing mistakes I failed to notice.
Markus Reger
Oracle Applications DBA
Webmaster
MBC
University for Music and Performing Art
Vienna
[EMAIL PROTECTED] 02/25/03