3 ms·
It is intrinsically a nop, but its context can have side effects because it's still a real command. One side effect is exploited here: setting $_ to the last ar
by mrspuratic 5y ago
It is intrinsically a nop, but its context can have side effects because it's still a real command. One side effect is exploited here: setting $_ to the last argument of the previous command. The first description in the article of its use is unhelpful, it's not until the end in "Simpler case statement" that it's made clear.
I often use it instead of truncate or touch
: > somefile
: >> somefile
: is not lexically special (the way # is), you can use : in variable and function names, even create a function called just ":" if you're trying to confuse...