What does the -z expression stand for?

What does - z and {} means

if [ -z "${ARBORDBU}" ] ; then
        echo "ERROR: \$ARBORDBU environment variable is not set\n"
$ man test
...
       -z STRING
              the length of STRING is zero
...
1 Like

Hi zaxxon

how can i store the value of this evironmental value in a vriable
echo $ARBORDBU
gives as DEV as output.
how can i store output i.e. in $ARBORDBU in a variable

you can easily store the content of the variable $ARBORDBU in another variable e.g. var with the below assignment.

var=$ARBORDBU

is it valid

ARBORDBU=$ARBORDBU ; export ARBORDBU

technically the assignment statement is valid, but why you would want to re-assign already defined environment variable?

I know but i am having a quite weird issue.Stuck for 16 hours now:confused::frowning:

If it says it's not assigned, I'm inclined to believe it. Something else is going on.

Perhaps there's a minor error or typo in the variable name which means the wrong one is being set or the wrong one is being tested. Remember that variable names are case-sensitive.

$ARBORDBU can be environment variable (process environment) or a shell variable.

export ARBORDBU

links the shell variable to the environment, substituting a prior ARBORDBU.