Operating System - HP-UX
1833878 Members
1895 Online
110063 Solutions
New Discussion

Re: Comments for char comment (#)

 
SOLVED
Go to solution
Carlos Fernandez Riera
Honored Contributor

Comments for char comment (#)

From man ksh :

# The # character is interpreted as the beginning of a
comment. See Quoting
below.



now:

dd if=ppp# of=ppp#2 will read file "ppp#" and create file "ppp#2".

But it should be wrote as dd if=ppp\# or am i in a mistake?


unsupported
3 REPLIES 3
RikTytgat
Honored Contributor

Re: Comments for char comment (#)

Hi,

A part of a line is only considered to be a comment id it starts with the # sign, preceded by whitespace (newline, tab, space, ...)

Other shell constructs rely on the '#' sign, too.

Bye,
Rik
RikTytgat
Honored Contributor
Solution

Re: Comments for char comment (#)

Hi,

From the sh-posix manpage:

# Comment delimiter. A word beginning
with # and all following characters
up to a newline are ignored.


And:

word A sequence of characters separated
by one or more nonquoted
metacharacters.

Bye,
Rik
Carlos Fernandez Riera
Honored Contributor

Re: Comments for char comment (#)

 
unsupported