variable assignments in script ${VAR1:=default}
ubu1404@ubuntu1404lb01:~$ echo ${a1:=default}
default
ubu1404@ubuntu1404lb01:~$ a1=val
ubu1404@ubuntu1404lb01:~$ echo ${a1:=default}
val
ubu1404@ubuntu1404lb01:~$ unset a1
ubu1404@ubuntu1404lb01:~$ echo ${a1:=default}
default
ubu1404@ubuntu1404lb01:~$
default
ubu1404@ubuntu1404lb01:~$ a1=val
ubu1404@ubuntu1404lb01:~$ echo ${a1:=default}
val
ubu1404@ubuntu1404lb01:~$ unset a1
ubu1404@ubuntu1404lb01:~$ echo ${a1:=default}
default
ubu1404@ubuntu1404lb01:~$
Comments
Post a Comment