I know !! re-runs commands but what exactly would occur if I re-ran a command that had a variable in the command?
Why must you be careful when using Bash's built in command history function to re-run previous commands that contain variables?
bash;command history;function;variable
Well, let's try it:$ foo=bar$ echo $foobar$ foo=qux$ !-2echo $fooqux$ history...  219  foo=bar  220  echo $foo  221  foo=qux  222  echo $foo  223  historySo it appears that the command is added to history before variable expansion occurs.