Solved

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

Posted on 2009-04-07
1
474 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

759 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

20 Experts available now in Live!

Get 1:1 Help Now