As I understood things, lines in a script that begin with a "#" character are ignored and can be used for comments. I'm confused though because I see other scripts that seem to use the "!" character to comment-out lines and use the "#" character to begin lines containing conditional syntax (if, endif, else etc). What's going on? thanks. james mccreery ********************************************************************* This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify postmaster@haymarketgroup.com Whilst every endeavour is taken to ensure that e-mails are free from viruses, no liability can be accepted and the recipient is requested to use their own virus checking software. www.haymarketgroup.com **********************************************************************
James McCreery wrote:
As I understood things, lines in a script that begin with a "#" character are ignored and can be used for comments. I'm confused though because I see other scripts that seem to use the "!" character to comment-out lines and use the "#" character to begin lines containing conditional syntax (if, endif, else etc). What's going on?
At first I had no idea what you were on about... and I'm still not totally clear. Can you give me an example of a script that uses the ! character? The '#' character is usually used to comment out lines/parts of lines in most scripts (e.g. bash, perl, etc.). When used in 'C' source files (which aren't scripts) they are use to give the preprocessor commands (e.g. #define, #ifdef, #endif, etc.). To be honest, I can't think of anything of the top of my head which, in UNIX, uses '!' as a comment character... Bye, Chris -- __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\
## Chris Reeves <chris.reeves@iname.com> on: Tue, 03 Apr 2001 14:46:38 +0100 ## ::> To be honest, I can't think of anything of the top of my head which, in chris.reeves::> UNIX, uses '!' as a comment character... ???? ~/.Xdefaults
Today, Apr 3, James McCreery wrote:
As I understood things, lines in a script that begin with a "#" character are ignored and can be used for comments. I'm confused though because I see other scripts that seem to use the "!" character to comment-out lines and use the "#" character to begin lines containing conditional syntax (if, endif, else etc). What's going on?
I'm assuming you mean the "hash-bang" line? Scripts use a #! line to tell the system how to process the script. #!/bin/sh says to use the shell, #!/usr/bin/perl says to use perl. This is only applicable when it's the first line in the script. hth Ken -- "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." -- Howard Aiken
Today, Apr 3, James McCreery wrote:
As I understood things, lines in a script that begin with a "#" character are ignored and can be used for comments. I'm confused though because I see other scripts that seem to use the "!" character to comment-out lines and use the "#" character to begin lines containing conditional syntax (if, endif, else etc). What's going on?
Okay. Sorry. I actually read your entire message this time. As a result, please disregard my previous "answer" ;^) Ken -- Some programming languages manage to absorb change, but withstand progress. -- Epigrams in Programming, ACM SIGPLAN Sept. 1982
participants (4)
-
Chris Reeves
-
Francesco Scaglioni
-
James McCreery
-
Ken Hughes