Skip to content

Instantly share code, notes, and snippets.

View dnapier's full-sized avatar

David Napier dnapier

View GitHub Profile
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
@dnapier
dnapier / expecting.md
Created March 27, 2018 00:51 — forked from ksafranski/expecting.md
Basic principles of using tcl-expect scripts

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect

Keybase proof

I hereby claim:

  • I am dnapier on github.
  • I am dnapier (https://keybase.io/dnapier) on keybase.
  • I have a public key ASDk9cvit9wJMe8MNE_-KZjQ5rafeedLbkOE7yZoy-gHnwo

To claim this, I am signing this object: