Eikonal Blog

2010.12.02

Unix “script” command

Filed under: unix — Tags: , , — sandokan65 @ 12:16

Implementation of the same functionality in Expect

Cygwin does not come with the “script” commands, so following implementation in Expect can do the same thing:

    script.expect
    #!/bin/expect
    
    spawn /bin/bash
    
    if {[lindex $argv 0]==""} {
            log_file SESSION.txt
       } else {
            log_file [lindex $argv 0]
       }
    
    interact
    

Create a free website or blog at WordPress.com.