User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 422,380 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,704 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 2080 | Replies: 2
Reply
Join Date: May 2005
Posts: 1
Reputation: zkjian517 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zkjian517 zkjian517 is offline Offline
Newbie Poster

what's the meaning of " ${1:-} "?

  #1  
May 4th, 2005
when i read linux boot scripts, i often meet this expression: ${1:-}. i can't understand it. what's more, i don't understand this condition: [ -z "${1:-}" ] too. anyone can help me ? thanks!!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2004
Posts: 21
Reputation: vgersh99 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
vgersh99's Avatar
vgersh99 vgersh99 is offline Offline
Newbie Poster

Re: what's the meaning of " ${1:-} "?

  #2  
May 5th, 2005
Originally Posted by zkjian517
when i read linux boot scripts, i often meet this expression: ${1:-}. i can't understand it. what's more, i don't understand this condition: [ -z "${1:-}" ] too. anyone can help me ? thanks!!!

[quote man ksh]
${parameter:-word}
Use Default Values. If parameter is unset or null,
the expansion of word will be substituted; other-
wise, the value of parameter will be substituted.

-z string True, if length of string is zero.
[/code]
vlad
+-----------------------------------+
| #include <disclaimer.h> |
+-----------------------------------+
Reply With Quote  
Join Date: Nov 2004
Posts: 21
Reputation: vgersh99 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
vgersh99's Avatar
vgersh99 vgersh99 is offline Offline
Newbie Poster

Re: what's the meaning of " ${1:-} "?

  #3  
May 5th, 2005
doing 'man ksh' yields:
Originally Posted by vgersh99
Originally Posted by man ksh
${parameter:-word}
Use Default Values. If parameter is unset or null,
the expansion of word will be substituted; other-
wise, the value of parameter will be substituted.

-z string True, if length of string is zero.
vlad
+-----------------------------------+
| #include <disclaimer.h> |
+-----------------------------------+
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 8:34 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC