Help: Executing commands using Tcl Expect

Posted by musca001 on 2014-03-19 08:27
Forums: Expect discussion | OS: Windows 7

I have been trying for the past couple of days to get Tcl Expect to uncompress a .gz archive. What seemed like a simple task doesn't appear to be so simple after all.

My whittled-down script is:

# \
exec tclsh "$0" ${1+"$@"}
package require Expect

exec "\\Program\ Files\\7-Zip\\7z.exe\ e\ bulkstats.txt.gz"
expect "\top>"

What am I doing wrong? If I run "\Program\ Files\7-Zip\7z.exe" e bulkstats.txt.gz it runs just fine. I run the script from the same directory where the gz file is.

What is really strange is the rest of the script which spawns ssh's and ftp's works fine. It's just this part that I am stuck on.