scriptingcourse issueshttps://git.lumc.nl/courses/scriptingcourse/-/issues2017-09-13T00:56:30+02:00https://git.lumc.nl/courses/scriptingcourse/-/issues/4Evaluation (and notes for next time)2017-09-13T00:56:30+02:00Martijn Vermaatm.vermaat.hg@lumc.nlEvaluation (and notes for next time)Some notes based on this year's experiences.
General
-------
- Practicals were perceived as being harder than the lectures.
- Would be good to have the material finished and up on the website a bit earlier. Students *will* look...Some notes based on this year's experiences.
General
-------
- Practicals were perceived as being harder than the lectures.
- Would be good to have the material finished and up on the website a bit earlier. Students *will* look there before the course.
- Students really liked that there were enough (usually around 4) teachers during the practicals.
- Some students say they would have liked at least 3 days.
- Some students say they would have liked more interactive lectures with some live demos.
SSH practical
-------------
- Having one of the laptops as remote host worked fine, especially showing `watch 'who | wc -l; tree'` on the beamer was nice.
- On eduroam, different institutions appear to be on different subnets, so not any laptop could see any other laptop.
- Create a separate user on the 'remote host' and change its hostname. The open terminals are very confusing otherwise (no difference between local and remote shells).
https://git.lumc.nl/courses/scriptingcourse/-/issues/3Scripting: todo2017-09-13T00:56:30+02:00Martijn Vermaatm.vermaat.hg@lumc.nlScripting: todo- Notes about whitespace and lists and quoting
- Use double test brackets?
- Explain and use `$()` command substitution- Notes about whitespace and lists and quoting
- Use double test brackets?
- Explain and use `$()` command substitutionhttps://git.lumc.nl/courses/scriptingcourse/-/issues/2Lecture: sed, grep, rename2017-09-13T00:56:30+02:00Martijn Vermaatm.vermaat.hg@lumc.nlLecture: sed, grep, renameGeneral idea for the lecture, to be properly formatted later.
The common theme are regular expressions, so we will start by explaining the basics about them and then move on to practical examples with the tools sed, grep and rename.
...General idea for the lecture, to be properly formatted later.
The common theme are regular expressions, so we will start by explaining the basics about them and then move on to practical examples with the tools sed, grep and rename.
# Regular expressions
(Globbing is a simplistic form of regex matching.)
Pattern matching on strings.
This must be relatively quick, so we show the building blocks and basic examples. We'll skip all formal languages theory.
1. Quantification: `*` `+` `?`
2. Or: `abc|xyc`
3. Grouping: `(abc)*abc`
4. Character classes: `.` `\d` `\s`
5. More character classes: `[a-z0-9]` `[^.-]`
6. Start/end positions: `^` `$`
7. Matching (same syntax as grouping)
Write regular expressions interactively: http://www.regexr.com/
We start with grep, since it is easier:
1. We can use matching and references in sed
2. In GNU sed (standard on Ubuntu) many regex operators have to be escaped, unless `-r` is used.
# grep
# sed
Uses POSIX basic regular expressions, unless `-r` is used. Can use alternative delimiters.
# rename
https://git.lumc.nl/courses/scriptingcourse/-/issues/1Practical: Connecting to remote machines2017-09-13T00:56:30+02:00Martijn Vermaatm.vermaat.hg@lumc.nlPractical: Connecting to remote machinesGeneral idea for the practical, to be properly formatted later.
We will be doing some simple data analysis on a remote machine: counting the number of words in a dictionary file.
Steps:
1. Login to the remote machine (IP address...General idea for the practical, to be properly formatted later.
We will be doing some simple data analysis on a remote machine: counting the number of words in a dictionary file.
Steps:
1. Login to the remote machine (IP address is on the big screen). Create a directory for your own analysis.
2. Copy input data to the directory you just created on the remote machine. As input data you can use the dictionary file on your laptop (`/usr/share/dict/words`).
3. On the remote machine, count the number of lines in the dictionary and save the output in a file.
4. Copy the resulting file from the remote machine to your laptop.
5. Remove your analysis directory from the remote machine.
Instead of counting the number of words in the dictionary, we could also combine this practical with *The Bash shell and common command line tools* and have the student perform tasks related to that lecture on the remote machine.