[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about exit command
From: |
Davide Brini |
Subject: |
Re: question about exit command |
Date: |
Wed, 19 Jan 2011 13:43:34 +0000 |
User-agent: |
KMail/1.13.5 (Linux/2.6.36-gentoo-r5; KDE/4.4.5; x86_64; ; ) |
On Wednesday 19 Jan 2011 13:37:30 Greg Wooledge wrote:
> On Wed, Jan 19, 2011 at 10:49:47AM +0000, Davide Brini wrote:
> > In your second script, the "exit 0" part runs in a subshell, so "exit"
> > exits that subshell (and I'm somewhat surprised that no semicolon is
> > required after the closing bracket, but I may have missed something in
> > the grammar).
>
> He had parentheses (like this) not brackets.
I thought those were also a type of brackets (round brackets).
From wikipedia:
"Parentheses (singular, parenthesis) – also called simply brackets (UK), or
round brackets, curved brackets, oval brackets, or, colloquially, parens..."
http://en.wikipedia.org/wiki/Bracket#Parentheses_.28_.29
> You don't need semicolons to terminate commands inside parentheses.
I was not wondering about what's inside the parentheses, but rather why this
works
if (somecommand) then ...
while I would expect it should be
if (somecommand); then ...
or, alternatively,
if (somecommand)
then ...
But as I said, I haven't checked the grammar.
--
D.