Skip to content

Instantly share code, notes, and snippets.

@makkawysaleh
makkawysaleh / expecting.md
Created September 19, 2019 17:05 — 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
@makkawysaleh
makkawysaleh / README
Created March 15, 2019 03:27 — forked from goldsamantha/README
An implementation of Depth First Search in Python
This is a search algorithm implementation.
It takes a text file used to construct the tree
(use the example one exampletree.txt or your own)
To run:
$ python search.py <textfile.txt>