Skip to content

Commit 44f829a

Browse files
committed
Minor edits and formatting
1 parent 3c4dbf2 commit 44f829a

File tree

3 files changed

+101
-63
lines changed

3 files changed

+101
-63
lines changed

README.md

+56-40
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
- [Introducing the shell](#introducing-the-shell)
22
- [Reasons to use the shell](#reasons-to-use-the-shell)
3+
- [\"Unix\"](#unix)
4+
- [\"Shell\"](#shell)
35
- [The past is always with us](#the-past-is-always-with-us)
4-
- [So what is a \"shell\"?](#so-what-is-a-shell)
56
- [Navigating files and
67
directories](#navigating-files-and-directories)
78
- [File system layout](#file-system-layout)
@@ -40,47 +41,36 @@
4041
- [Simplify your loop with globs](#simplify-your-loop-with-globs)
4142
- [Generalize your loop with unlimited
4243
arguments](#generalize-your-loop-with-unlimited-arguments)
44+
- [Make your script executable](#make-your-script-executable)
4345
- [Finding things](#finding-things)
4446
- [Find](#find)
4547
- [Grep](#grep)
4648
- [Shell extras](#shell-extras)
47-
- [SSH](#ssh)
48-
- [Permissions](#permissions)
49-
- [Job control](#job-control)
50-
- [Aliases and bash
51-
customization](#aliases-and-bash-customization)
52-
- [More on shell variables](#more-on-shell-variables)
53-
- [Mini-languages (grep, sed, AWK)](#mini-languages-grep-sed-awk)
54-
- [Shell expansion](#shell-expansion)
55-
- [Conditional tests](#conditional-tests)
5649
- [Credits](#credits)
5750
- [References](#references)
5851
- [Data Sources](#data-sources)
5952

6053
# Introducing the shell
6154

62-
Powerpoint slides: \"Automate all the things!\"
63-
6455
## Reasons to use the shell
6556

6657
1. Automate basic tasks
67-
2. Underlies many other open source languages and applications; knowing
68-
the shell will make you better at using them
69-
3. System administration, HPC, and remote computing
70-
4. Many special-purpose tools become available to you
58+
2. Underlies many other open source languages and applications and can
59+
be used to glue them together
60+
3. Essential for system administration, remote computing, and
61+
high-performance computing
62+
4. Many concise special-purpose tools that can make your life easier
63+
5. Complements more fully-featured application programming languages
7164

72-
## The past is always with us
65+
## \"Unix\"
7366

74-
The design and terminology of modern computers is based on metaphors
75-
from a previous age.
67+
Powerpoint slides: Unix family tree
7668

77-
1. Files and folders
78-
2. Teletype input and output
79-
3. Modern touch devices don\'t expose the file system, so you may be
80-
less comfortable with navigating directory trees than people whose
81-
primary computing devices were desktop computers
69+
1. Unix-like operation systems share a common architecture and layout
70+
2. Roughly compatible, with similar (or identical) shells and tools
71+
3. The environment in which most open-source software was written
8272

83-
## So what is a \"shell\"?
73+
## \"Shell\"
8474

8575
- Broadly speaking, there is a tension between making computer systems
8676
fast and making them easy to use.
@@ -94,6 +84,17 @@ from a previous age.
9484
It provides a simple interface for making the operating system do
9585
work, without having to know exactly how it accomplishes that work.
9686

87+
## The past is always with us
88+
89+
The design and terminology of modern computers is based on metaphors
90+
from a previous age.
91+
92+
1. Files and folders
93+
2. Teletype input and output
94+
3. Modern touch devices don\'t expose the file system, so you may be
95+
less comfortable with navigating directory trees than people whose
96+
primary computing devices were desktop computers
97+
9798
# Navigating files and directories
9899

99100
## File system layout
@@ -683,6 +684,23 @@ bash latin.sh
683684
bash aggregate.sh ../proteins/*.pdb
684685
```
685686

687+
## Make your script executable
688+
689+
``` bash
690+
# List file in long format to show current permissions
691+
ls -l aggregate.sh
692+
693+
# Change file mode (i.e. permissions)
694+
# User can read/write/execute, Group and Other can read
695+
chmod u=rwx,go=r aggregate.sh
696+
697+
# Show changed permissions
698+
ls -l aggregate.sh
699+
700+
# Invoke script
701+
./aggregate.sh ../proteins/*.pdb
702+
```
703+
686704
# Finding things
687705

688706
## Find
@@ -716,23 +734,21 @@ find . -name "*.txt"
716734

717735
## Grep
718736

719-
# Shell extras
720-
721-
## SSH
722-
723-
## Permissions
724-
725-
## Job control
737+
TBD
726738

727-
## Aliases and bash customization
728-
729-
## More on shell variables
730-
731-
## Mini-languages (grep, sed, AWK)
732-
733-
## Shell expansion
739+
# Shell extras
734740

735-
## Conditional tests
741+
Consult the Wooledge Bash Guide (see references below) for more on these
742+
topics:
743+
744+
1. SSH
745+
2. Permissions
746+
3. Job control
747+
4. Aliases and bash customization
748+
5. Shell variables
749+
6. Mini-languages (grep, sed, AWK)
750+
7. Shell expansion
751+
8. Conditional tests
736752

737753
# Credits
738754

README.org

+41-23
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33

44
#+TITLE: Unix Shell
55
#+AUTHOR: Derek Devnich
6-
#+BEGIN_SRC bash
7-
8-
#+END_SRC
9-
#+BEGIN_EXAMPLE
10-
#+END_EXAMPLE
116

127
* Introducing the shell
13-
Powerpoint slides: "Automate all the things!"
14-
158
** Reasons to use the shell
169
1. Automate basic tasks
17-
2. Underlies many other open source languages and applications; knowing the shell will make you better at using them
18-
3. System administration, HPC, and remote computing
19-
4. Many special-purpose tools become available to you
10+
2. Underlies many other open source languages and applications and can be used to glue them together
11+
3. Essential for system administration, remote computing, and high-performance computing
12+
4. Many concise special-purpose tools that can make your life easier
13+
5. Complements more fully-featured application programming languages
14+
15+
** "Unix"
16+
Powerpoint slides: Unix family tree
17+
1. Unix-like operation systems share a common architecture and layout
18+
2. Roughly compatible, with similar (or identical) shells and tools
19+
3. The environment in which most open-source software was written
20+
21+
** "Shell"
22+
- Broadly speaking, there is a tension between making computer systems fast and making them easy to use.
23+
- A common solution is to create a 2-layer architecture: A fast, somewhat opaque core surrounded by a more friendly scriptable interface (also referred to as "hooks" or an "API"). Examples of this include video games, Emacs and other highly customizable code editors, and high-level special-purpose languages like Stata and Mathematica.
24+
- Unix shell is the scriptable *shell* around the operating system. It provides a simple interface for making the operating system do work, without having to know exactly how it accomplishes that work.
2025

2126
** The past is always with us
2227
The design and terminology of modern computers is based on metaphors from a previous age.
2328
1. Files and folders
2429
2. Teletype input and output
2530
3. Modern touch devices don't expose the file system, so you may be less comfortable with navigating directory trees than people whose primary computing devices were desktop computers
2631

27-
** So what is a "shell"?
28-
- Broadly speaking, there is a tension between making computer systems fast and making them easy to use.
29-
- A common solution is to create a 2-layer architecture: A fast, somewhat opaque core surrounded by a more friendly scriptable interface (also referred to as "hooks" or an "API"). Examples of this include video games, Emacs and other highly customizable code editors, and high-level special-purpose languages like Stata and Mathematica.
30-
- Unix shell is the scriptable *shell* around the operating system. It provides a simple interface for making the operating system do work, without having to know exactly how it accomplishes that work.
31-
3232
* Navigating files and directories
3333
** File system layout
3434
Powerpoint slides: "Navigating files and directories"
@@ -522,6 +522,22 @@ bash latin.sh
522522
bash aggregate.sh ../proteins/*.pdb
523523
#+END_SRC
524524

525+
** Make your script executable
526+
#+BEGIN_SRC bash
527+
# List file in long format to show current permissions
528+
ls -l aggregate.sh
529+
530+
# Change file mode (i.e. permissions)
531+
# User can read/write/execute, Group and Other can read
532+
chmod u=rwx,go=r aggregate.sh
533+
534+
# Show changed permissions
535+
ls -l aggregate.sh
536+
537+
# Invoke script
538+
./aggregate.sh ../proteins/*.pdb
539+
#+END_SRC
540+
525541
* Finding things
526542
** Find
527543
*** Find everything
@@ -549,16 +565,18 @@ find . -name "*.txt"
549565
#+END_SRC
550566

551567
** Grep
568+
TBD
552569

553570
* Shell extras
554-
** SSH
555-
** Permissions
556-
** Job control
557-
** Aliases and bash customization
558-
** More on shell variables
559-
** Mini-languages (grep, sed, AWK)
560-
** Shell expansion
561-
** Conditional tests
571+
Consult the Wooledge Bash Guide (see references below) for more on these topics:
572+
1. SSH
573+
2. Permissions
574+
3. Job control
575+
4. Aliases and bash customization
576+
5. Shell variables
577+
6. Mini-languages (grep, sed, AWK)
578+
7. Shell expansion
579+
8. Conditional tests
562580

563581
* Credits
564582
1. The Unix Shell: https://swcarpentry.github.io/shell-novice/

_config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
title: Unix Shell
2+
description: Class notes and code examples
3+
4+
remote_theme: jekyll/minima

0 commit comments

Comments
 (0)