I know I can run bash scripts placed inside gist.github.com using the following:
bash -c "$(curl -fsSL https://raw.github.com/gist/5126919)" <arg0> <arg1>
How do I do the same for expect scripts?
I have a sample here:
https://gist.github.com/simkimsia/5126919
#!/usr/bin/expect -f
set CHANGESHELL_FOR_USER [lindex $argv 0];
set PASSWORD_OF_USER [lindex $argv 1];
########################################
## switch to another user
## read this http://stackoverflow.com/a/1988255/80353
########################################
sudo -u $CHANGESHELL_FOR_USER -H sh -c "chsh -s /bin/bash"
expect "*?assword:*" {send -- "$PASSWORD_OF_USER\r";}
expect eof
My purpose is to chsh for a particular user.