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.

------------------------------------------------------------------------
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

Reply via email to