I need some help with he expect command. I am trying to unpack the teamspeak 3 Linux client automatically.
Here is my script to grab the file
#!/bin/sh
mkdir /home/test && cd /home/test
wget http://dl.4players.de/ts/releases/3.0.19.4/TeamSpeak3-Client-linux_amd64-3.0.19.4.run
chmod 0777 TeamSpeak3-Client-linux_amd64-3.0.19.4.run
Here is my expect script that gets executed after the script above ...
#!/usr/bin/expect -f
spawn sh TeamSpeak3-Client-linux_amd64-3.0.19.4.run
expect "\[RETURN\]"
send "\r"
expect ":"
send "q"
expect "Please type y to accept, n otherwise:"
send "y\n"
It does NOT uncompress and it should.
Thank you so much!
send "q\r"
andsend "y\r"
, assuming the expected strings are correct.\r
(theq
just quits theless
pager that's used to display the agreement); adding it just makes it present they/n
question twice.