The goal of this tutorial is to introduce researchers to bash and scripting. It is a short tutorial that shows major concepts with use cases related to research work.
Authors: Fadi Nammour , Julien N. Girard
Year: 2020
Email: [email protected], [email protected] (screen segment)
- Introduction
- Basics
- Pipeline, pipes and filters
- Bash Scripts
- Screening
- Beyond the Scope
- Acknowledgements
- Resources
To start this tutorial, it is possible to launch it online using Binder with no installation required, or install it and start it locally using Docker as follow:
Click on the following icon to launch the tutorial .
-
Install Docker
-
Run the following command in a terminal:
docker run -p 8889:8889 -v ${PWD}:/home/jovyan/:rw -it fadinammour/bash-intro start-notebook.sh --NotebookApp.port=8889 --NotebookApp.token=''
Note 1 The number
8889
appears three times. The first occurence correspond to the port number of the local machine. The second one corresponds to the port of the docker container and the third one is the port of the Jupyter notebook. If you want to change the port numbers, the last two should be the same.
Note 2 The empty string argument
''
passed to the--NotebookApp.token
options shortcuts the token verification step. However it is not recommanded to be used with distant work for security reasons, in that case the option can just be erased.
- Open the Jupyter notebook in a browser by copying the link that appears in the terminal and pasting it to the browser. In case, the link does not work try entering the following address instead
0.0.0.0:8889
.
Note 3 The number
8889
here corresponds to the port number of the local machine. In case this number is changed, it should be also be changed in the previous step.
Here is a list of functions and concepts that were not covered by this tutorial:
- arithmetical operation
- regular expressions
- bash profil
- aliases
- shabang
- chown
- ssh
- sed
- chmod
- functions
- boolean operations
- wildcards (globbing)
- loops and conditions
For curious readers, these notions are explained in the links of the Resources section.
This work has been made easier thanks to the valuable help and assistance of Samuel Farren and François Lanusse.
This tutorial was inspired by the following:
- The Unix Shell lesson part of the data used in the tutorial was taken from this resource.
- The Missing Semester of Your CS Education
- How to Use Linux Screen
Additionnal material: