Friday, October 21, 2011

Re: Syntax highlighting Problem in for Bash

On 2011-10-21, Tony Mechelynck wrote:

> In bash (as can be seen with "help :" without the quotes at the bash
> prompt) : is a do-nothing command. So it can be regarded as
> legitimate to treat it as a comment.

While it is true that the : command does nothing, its arguments are
still expanded, redirections are performed, and it sets the exit
code to 0, so it is not true that it can be regarded as a comment
line.

As a practical example, this command tests USER and if it is unset
or empty, sets it to the output of whoami.

: ${USER:=`whoami`}

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: