I was looking through PSDrives and the variables listed there and discovered a few and I am not 100% sure what they are doing or what their practical application is.
I run: echo "test"
It returns test
Easy enough.
From here I run: $^
and it returns the last command I ran echo
When I run $$
it returns the output of the last command I ran test
Is that what they are supposed to do or is that just also what is happening here? What is the practical application?
Also.
Running $?
always returns True
and running !$?
always returns False
What exactly would be the purpose of using these in that context?
if(!$?){do something}
if what is false? I'm confused.
EDIT: $^ and $$ return the first and last token. So I understand that, but still don't see a practical application