What does it mean: ${VOLROOT_DIR:=$__VXVM_ROOT_DIR}

What does it mean: ${VOLROOT_DIR:=$__VXVM_ROOT_DIR}

Post by kevi » Mon, 21 Jan 2002 16:42:36



Hi,

When I read someone else's shell script, I find the following sentence,
Would someone tell me what does it mean?

: ${VOLROOT_DIR:=$__VXVM_ROOT_DIR}

Thanks

Kevin

 
 
 

What does it mean: ${VOLROOT_DIR:=$__VXVM_ROOT_DIR}

Post by Tony Lawrenc » Mon, 21 Jan 2002 17:22:48



> Hi,

> When I read someone else's shell script, I find the following sentence,
> Would someone tell me what does it mean?

> : ${VOLROOT_DIR:=$__VXVM_ROOT_DIR}

It means that VOLROOT_DIR will be set to $_VXM_ROOT_DIR if VOLROOT_DIR
isn't already set.  But if it already has been set, it won't change.
Oftyen used to set fdefault values that can be overridden at the command
lne.

You'll find this and other useful shortcuts like this in the man page for your shell.

--
Tony Lawrence
SCO/Linux Support Tips, How-To's, Tests and more: http://pcunix.com

 
 
 

What does it mean: ${VOLROOT_DIR:=$__VXVM_ROOT_DIR}

Post by Chris F.A. Johnso » Tue, 22 Jan 2002 03:02:46




> > When I read someone else's shell script, I find the following sentence,
> > Would someone tell me what does it mean?

> > : ${VOLROOT_DIR:=$__VXVM_ROOT_DIR}

> It means that VOLROOT_DIR will be set to $_VXM_ROOT_DIR if VOLROOT_DIR
> isn't already set.  But if it already has been set, it won't change.

Actually, it sets VOLROOT_DIR if it is unset or its length is zero.

To set VOLROOT_DIR only if it is unset:

        : ${VOLROOT_DIR=$__VXVM_ROOT_DIR}

Quote:> Oftyen used to set fdefault values that can be overridden at the command
> lne.

> You'll find this and other useful shortcuts like this in the man page for your shell.

--
    Chris F.A. Johnson                        http://cfaj.freeshell.org
    ===================================================================
    My code (if any) in this post is copyright 2002, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License
 
 
 

1. llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

On Mon, 23 Sep 2002 05:03:56 +0100, Osama Bin Laden assert()ed:

We finally have something in common.  I wish you were dead too.

--
General Protection Fault

 10:40am  up 12 days, 16:10,  2 users,  load average: 0.01, 0.03, 0.00
Linux nitrogen.ertw.com 2.4.9-34 #1 Sat Jun 1 06:32:14 EDT 2002 i586 unknown

2. New driver - what do I do?

3. P L, PPCQAU7HGUTGG..........................VCCCCCCCCCCCCC AAAAAAAAAAAAAAAAAAAAANNNNNNNNNNNNNNNNNN777777777777777RRRRRRRRRRRRRRRRRBBBBBBBBBBBBBBBBBBBBBBB

4. 1 network on a multi-homed machine...

5. TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

6. Timezone problems under Ultrix 4.3

7. +++GET YOUR FREE PENTIUM CELERON-300+++____________________________________________________________________________________________w09 wpiypw pwioierio

8. Changing Jittlov Icons?

9. Police Forensic & Evidence Elimination programs jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjujjjjjjjjjjjjjjjjjjjjjjjjjjjjj 643 [1/2]

10. ################################################################################################

11. +++GET YOUR FREE PENTIUM CELERON-300+++____________________________________________________________________________________________kefldhlsdf aljreth skfdhtie erh493o3i

12. Xconfig: truecolor/pseudocolor/staticcolor what does it mean ?