Re: Newbie-ish question about ( [ and [[
- From: "Michael" <pweber7@xxxxxxxxxxxx>
- Date: 20 Dec 2006 09:52:55 -0800
Thanx for the great input. I think I'm beginning to get the light bulb
turned on.
Here's what I believe y'all said.
The construct ( blah ) means:
( # Open a new subshell
Blah # Execute the "Blah" command(s) and save the exit status
) # Close the subshell and return the exit status of Blah to
the calling shell
So, I can actually put any command or command string inside of the "(
)" that returns an exit status that the "if" then evaluates. Operators
are permitted, but only as they relate to the commands.
Next, the construct [ foo ] means:
[ # Execute the alias of the test command on the following
Blah # something that the test command can legally evaluate
] # terminus of what is being tested
So the contents of the "[ ]" must contain operators, not commands;
unless an operator is operating on the result of a command.
Did I get it right?
Thanx!
.
- Follow-Ups:
- Re: Newbie-ish question about ( [ and [[
- From: Janis Papanagnou
- Re: Newbie-ish question about ( [ and [[
- References:
- Newbie-ish question about ( [ and [[
- From: Michael
- Re: Newbie-ish question about ( [ and [[
- From: Kaz Kylheku
- Newbie-ish question about ( [ and [[
- Prev by Date: Re: BASH: Can bash do this?
- Next by Date: Re: Newbie-ish question about ( [ and [[
- Previous by thread: Re: Newbie-ish question about ( [ and [[
- Next by thread: Re: Newbie-ish question about ( [ and [[
- Index(es):
Relevant Pages
|