How to access environment variables in an Expect script? May 12, 2023 by Tarik Expect is an extension of Tcl. Tcl access enviroment variables via the global env array: send_user "$env(PATH)\n"