I'm not talking about the UNIX shebang meant to give the path of an interpreter. In fact, the shebang has made it quite hard to google this question successfully...
I'm talking about
echo echo !#
echo echo echo echo
As mentioned in 2 comments and 1 answer, you can easily find the section of
!# The entire command line typed so far.
What isn't made explicit by the man pages or other documentation and perhaps leading you your bafflement to a useful use for
!# is that bash even designators are meant to be used in combination with the word designators and modifiers (found just below event designators on the man page). The use cases also make more sense when chaining commands together with pipes,
I could use the substitution modifier to run a script
foo.sh against two inputs
$ ./foo.sh bar; !#:s/bar/baz/
expands to form:
./foo.sh bar; ./foo.sh baz;
Or an example from the Docs (R.I.P. Docs) reproduced below shows how to use the word selector
:N to select the first argument to the command as typed so far and neatly cd into the just created directory:
$ mkdir backup_download_directory && cd !#:1 mkdir backup_download_directory && cd backup_download_directory
These examples are pretty trivial, but I hope they show how
!# could really save somebody some serious redundant typing while crafting powerful one-liners.