Operating System - Tru64 Unix
1753424 Members
4750 Online
108793 Solutions
New Discussion юеВ

Re: Tru64 v5.1 Rev.732 .profile $PATH question

 
SOLVED
Go to solution
YLTan
Frequent Advisor

Tru64 v5.1 Rev.732 .profile $PATH question

What does "-" implies in the .profile path??
PATH=$HOME/bin:${PATH:-/usr/bin:.}

Removing the "-" will cause bad substitution.

Why Tru64 have its part of the PATH to be substitute as ${PATH:-/usr/bin:.}

Any implication if I move the . current dir. to outside the curly bracket??
tyl
2 REPLIES 2
rachel_11
Advisor
Solution

Re: Tru64 v5.1 Rev.732 .profile $PATH question

Hello,

Look at man for ksh.
The syntax of ${parameter:-word} is, if parameter not set or null use word.
for example:
$ echo ${KUKI}
sh: KUKI: Parameter not set.
$ echo ${KUKI:-abcdef}
abcdef

Re: Tru64 v5.1 Rev.732 .profile $PATH question

The :- performs a conditional substitution. See sh(1b):

${ variable:-string }
If the variable is set and is not null, substitute the value of variable in place of this expression. Otherwise, replace this expression with the value of string.

In the .profile the conditional subsitution is used to generate /usr/bin:. if PATH has not yet been set.