Solved

What is meant by variable=${1:-0} in shell script?

Posted on 2009-04-07
1
478 Views
Last Modified: 2013-12-26
What is meant by variable=${1:-0} in shell script?
0
Comment
Question by:ANISHKA1
1 Comment
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 24087440
      ${parameter:-word}
              If parameter is set and is non-null then substitute  its  value;
              otherwise substitute word.

       Positional parameters, parameters denoted by a number, may be  assigned
       values with the set special built-in command.  Parameter $0 is set from
       argument zero when the shell is invoked.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now