Default value of variable in bash -


what default value of variable $y in bash scripting?

i want perform sum of n input numbers why needed this.

if

echo $y 

this show empty (null string) default value. however, set default bash variable, syntax is:

var=${1:-default}     

this sets var value of 1st arg script, if not available sets default


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -