Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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