Created
October 3, 2012 13:56
-
-
Save bancek/3827043 to your computer and use it in GitHub Desktop.
Bash init buffer. Usage: bashinit "cd some/path\rdosomething\r"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
trap { | |
set rows [stty rows] | |
set cols [stty columns] | |
stty rows $rows columns $cols < $spawn_out(slave,name) | |
} WINCH | |
spawn "/bin/bash" | |
set args [split [lindex $argv 0] ";"] | |
foreach element [lrange $args 0 end-1] { | |
set celement [string trim $element] | |
send -- "$celement\r" | |
} | |
set last [string trim [lindex $args end]] | |
send $last | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment