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) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -