Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

The asterisk * is a glob. Since double-quotes allow variables inside to be dereferenced rather than always quoting everything literally, presumably he was expecting that double-quotes might still allow globs to work rather than causing them to be quoted, when in fact all quotes will quote globs whether single or double. So he was expecting it might print out "a".


sort by: page size:

> What about then, like some other languages?

I assume there's a double asterisk there, and it's being eaten by the formatter?


Ha that's funny. I'd been copying my notation from the parent post, and I assumed 'd' was just their notation. I didn't realise they meant to say

    *d*
(apparently HN doesn't let you escape asterisks).

Wow, forgot about the \asterisk being a reserved character.

I'm confused, why do you have to escape an asterisk?

What's the point of having different quotation marks that are not ascii? Sounds like a formatting nightmare.

>> [...] The disgruntled victim later said he had been sorely tempted to go to Warren's office, tie Warren down in his chair in front of his workstation, and then type 'delete $' twice.

Ironically, this did not render the way you intended because HN interpreted the asterisk as an emphasis marker in this line.

It works here:

    ... type 'delete *$' twice.
because the line is indented and so renders as code, but not here:

> ... type 'delete $' twice.

because the subsequent line has emphasized text*. So the scoping of the asterisks is all screwed up.


Markdown ate the asterisks in the code snippet. Important to realize that if you're not terribly familiar with C.

Because asterisks are meant to hide the fine print, not make it easily accessible?

I just preceded the asterisks with a backslash.

Oops that’s the asterisk (star character) that HN interpreted as italics. In hacker news formattingnmy two examples are

  `!*` and !gi:*

btw, how did you escape that asterisk in quotes?

It’s because Hacker News parsed the asterisks in the expression as italic markers.

The asterisk is used for italics. If you leave one at the end of your comment it does this, it seems.

I can reproduce this behavior. Though I noticed that removing a newline with <Delete> does cause the asterisk to appear.

What's the point of this? It seems like it's the same as not including the asterisk in the first place.

I did not know you could backslash-escape asterisks (TIL! thanks!), so I prepended it with 4 spaces to make a code block.

Sorry, I wanted to use "sh*t", but a single asterisk actually acts as a special formatting character. Too late, I can't edit it.

> (OK, who broke the * for italics markup?)

You did by including a space after the asterisk ;)

The trailing one can have a space but the * leading* can't have one


It's working for me because I'm only using one asterisk, but not using any special formatting.

As long as I only say *Nix once, no italics...

next

Legal | privacy