I was playing with string substitution while learning a bit more of bash, and I have add !! into some dummy example echo ${TEST/hey/!!}...
I was surprised that !! was replaced with last entered command... what is it? is it somehow connected to magick codes link $? or $_ or even -. Is there anything else I can use in same manner in bash?
$_and!$will get you the same with simple commands).!will get you the "bang" / history expansion, a mechanism inherited fromcsh. Go read the "HISTORY EXPANSION" chapter from the bash manual. – Dec 28 '18 at 10:03