two question about expect srcipt

Hi experts,

I have two question about expect script

questions 1

send "tar -xjvf a.tar\r"
send "ifconfig\r"

I want to know if it just run "ifconfig after "tar -xjvf a.tar complete. or the two cmd run at the same time

question 2

after I use the expect to ssh to the target pc (hostname=intel_server)
I want to run expect "intel_server" but, I don't know it's hostname called "intel_server" before, I know run "hostname" on the target pc after to get it, but how to let expect to get it then I can run expect "intel_server"

Question 1

Since there is not an 'expect' between the two send commands, probably both commands are running at almost the same time. Many variables such as processor speed, what else is running on the computers, size of the tar file...

Question 2

Not sure what you are looking for here - but, from the Expect Wiki page