Skip to content

Instantly share code, notes, and snippets.

@BCadet
Created February 20, 2023 14:07
Show Gist options
  • Save BCadet/c78c275de2c4a6127b8c6576db272e98 to your computer and use it in GitHub Desktop.
Save BCadet/c78c275de2c4a6127b8c6576db272e98 to your computer and use it in GitHub Desktop.
expect script to automate installation of the microchip xc32 toolchain
#!/usr/bin/expect
# usage: ./install_xc32.expect ./xc32_<version>-full-install-linux-x64-installer.run
set installer [lindex $argv 0]
set install_args [lindex $argv 1]
spawn $installer
set timeout -1
expect {
"Press \\\[Enter\\\] to continue:" { send "\r"; sleep 0.1; exp_continue}
"Do you accept this license? \\\[y/n\\\]: " {send "y\r"; sleep 0.1; exp_continue}
"\\\[Y/n\\\]:" {send "n\r"; sleep 0.1; exp_continue}
"\\\]*:" {send "\r"; sleep 0.1; exp_continue}
"Setup has finished the requested actions for MPLAB XC32 Compiler on your computer." {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment