1748018 Members
3393 Online
108757 Solutions
New Discussion юеВ

Re: : comment?

 
SOLVED
Go to solution
Volker Borowski
Honored Contributor

Re: : comment?

Robin has a point !
I use a dummy command from good old assembler times, cause ":" can cause these questions.

NOP=1

No OPeration :-)

Keep Assembler alive :-)
Volker
Wodisch
Honored Contributor

Re: : comment?

Hello,

the command ":" is NOT a null command! Actually everything following it is evaluated, substituteted, and such.
So after
: ${x:=wow}
the variabel "$x" conatains "wow" only if it was previously empty!

HTH,
Wodisch
Darrell Allen
Honored Contributor

Re: : comment?

Here's my 2 cents:

: is not a comment. It is essentially a null command. It does not process command line args yet the shell still interprets them. It is sometimes used like a comment because it doesn't do anything and the comments are ignored arguments. The shell is doing the work.

You can create your own null command by creating an empty file. It will work just like Wodisch's example.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Deepak Extross
Honored Contributor

Re: : comment?


#: ${x:=wow}

#echo $x
wow

#: echo $x


whee..aint this fun?
Wodisch
Honored Contributor

Re: : comment?

evaluated - not executed! :-)