Re: Can $1 be set in a script?
- From: floyd@xxxxxxxxxx (Floyd L. Davidson)
- Date: Thu, 30 Mar 2006 23:15:35 -0900
larryalk <nobody@xxxxxxxxxxx> wrote:
On Fri, 31 Mar 2006 01:35:57 -0500, Bill Marcum <bmarcum@xxxxxxxxx>
wrote:
something=${1:-"default string"}
Excellent point.
Bill I ran across this exact same construction before in connection
with an ~/.xinitrc script.
Would you please tell me what the syntax means of:
(1:-"default string")
It does exactly the same thing that the several lines of my code
did.
I _guess_ it represents a variable.
What does the colon and minus sign signify?
Why guess... you should read the man page for bash...
Start by reading the section titled "Parameter Expansion".
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@xxxxxxxxxx
.
- Follow-Ups:
- Re: Can $1 be set in a script?
- From: larryalk
- Re: Can $1 be set in a script?
- References:
- Can $1 be set in a script?
- From: larryalk
- Re: Can $1 be set in a script?
- From: Chris F.A. Johnson
- Re: Can $1 be set in a script?
- From: larryalk
- Re: Can $1 be set in a script?
- From: Floyd L. Davidson
- Re: Can $1 be set in a script?
- From: Bill Marcum
- Re: Can $1 be set in a script?
- From: larryalk
- Can $1 be set in a script?
- Prev by Date: Re: Can $1 be set in a script?
- Next by Date: Re: KDE/X dual head issue
- Previous by thread: Re: Can $1 be set in a script?
- Next by thread: Re: Can $1 be set in a script?
- Index(es):
Relevant Pages
|