[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell comment ignored

From: Eric Blake
Subject: Re: Shell comment ignored
Date: Thu, 16 Aug 2012 23:02:34 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

On 08/16/2012 06:36 PM, Keith Clifford wrote:
> some_var=# What I thought was a comment.

Not the first byte of a word.

# starts a comment only when it is the first byte of a word.

You can write:

some_var= #Now this is a comment, since there is space between = and #

if you meant for some_var to be assigned the empty string, or write:

some_var='# Embedded as part of the assignment'

if you meant to include more than just the # in the value assigned to
the var.

> some_var=#What
> Then some_var is set to '#What'.

Yep, and that is correct behavior as mandated by POSIX.

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]