Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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