Skip to content

Instantly share code, notes, and snippets.

@HariSekhon
Created March 22, 2024 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HariSekhon/e92fa987d8e2037ebe95fbbd7ecc6145 to your computer and use it in GitHub Desktop.
Save HariSekhon/e92fa987d8e2037ebe95fbbd7ecc6145 to your computer and use it in GitHub Desktop.
programming.md from HariSekhon/Knowledge-Base repo: https://github.com/HariSekhon/Knowlege-Base

Programming

Languages

  1. Bash - the gold standard for shell scripting
  2. Python - general purpose object oriented language, easy to write, widely used but hard to maintain due to environment differences, language and library changes over time
  3. Golang - imperative compiled self-contained binaries, simple toolchain, smashes Python in portability, maintainability, build time etc.
  4. Perl - fast to write imperative code, stable, the gold standard for regex string processing, works everywhere and doesn't break every few years like Python
  5. Groovy - a better version of Java, with interactive REPL and some language construct conveniences. Hard to want to write in Java again after getting spoilt by Groovy
  6. Java - battle tested, but slower to develop in than the above languages
  7. Scala - was supposed to be the next Java but wasn't
  8. Kotlin - another next Java, we'll see
  9. Clojure - another JVM language
  10. R - old data analytics languages, matrices, awkward, but widely used and lots of libraries
  11. Expect - an extension of the Tcl language specialized in interactive text interface automation and keystroke control

Expect

Brilliant for automating systems which have no alternative but interactive timed text inputs.

Autoexpect - generates an expect script from an interactive session, tune from there

Expect has libraries in most languages.

For example, used Perl's Net::SSH::Expect library to test iDRAC and iLO controllers in check_ssh_login.pl

Add this to the top of an expect script to debug output:

exp_internal 1
Ported from various private Knowledge Base pages 2008+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment