What is the meaning of !#:3?
Asked Answered
C

1

13
 curl http://beyondgrep.com/ack-2.02-single-file > ~/bin/ack && chmod 0755 !#:3

What is the meaning of !#:3, from ack installation guide?

Carpal answered 23/4, 2013 at 8:54 Comment(1)
See also: #12885917Eleanor
L
15

In bash or zsh ! denotes a history command (not a shebang line which is #!, and has nothing to do with bash or zsh as such).

!# means the entire command line typed so far, and :3 selects the third word, in this case ~/bin/ack.

So the command is equivalent to:

 curl http://beyondgrep.com/ack-2.02-single-file > ~/bin/ack && chmod 0755 ~/bin/ack
Lintel answered 23/4, 2013 at 8:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.