--- John Horne <[EMAIL PROTECTED]> wrote: > Hello,
> 
> Anyone want to tell me why a semicolon at the beginning of a shell
> line
> causes an error?
> 
> The following work fine under sh, bash, ksh and csh (redhat 7.0):
> 
>   date;ls -l
>   date;ls -l;
> 
> but ';date;ls -l' fails under all shells except csh with the error:
> 
>   sh: syntax error near unexpected token `;d'
>   bash: syntax error near unexpected token `;d'
>   pdksh: syntax error: `;' unexpected
> 
> I see no real reason for this, and a semicolon at the end of the
> line seems
> to be accepted okay. Just curious.
> 
> 
> 
> Regards,
> 
> John.

Not certain about this but probably to do with the fact that the ;
usually acts as as a command  terminator.


>
------------------------------------------------------------------------
> John Horne, University of Plymouth, UK           Tel: +44 (0)1752
> 233914
> E-mail: [EMAIL PROTECTED]
> PGP key available from public key servers
> 
> 
> 
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list 

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to