[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Why "; ;" is a syntax error?
From: |
Dan Douglas |
Subject: |
Re: [Help-bash] Why "; ;" is a syntax error? |
Date: |
Wed, 24 Jun 2015 00:45:15 -0500 |
On Tue, Jun 23, 2015 at 10:25 PM, Peng Yu <address@hidden> wrote:
> Hi, "; ;" is a syntax error. Could anybody help me understand why bash
> is defined in this way?
>
> $ ; ;
> -bash: syntax error near unexpected token `;'
>
Because a <separator_op> or <separator> must occur in the context of a
<list>, <and_or>, or <term>, none of which can produce space or empty
string. separator_op linebreak ls valid which is why you can have one
separator by itself on a line.
That said, I don't quite see where $';\n;' becomes an invalid
program. ksh and zsh accept it.
Re: [Help-bash] Why "; ;" is a syntax error?,
Dan Douglas <=