Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit80d2ff6ad5047e01388a451d0ce3fbe104195b65 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-02-26 20:42:17 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-02-26 20:42:17 +0200
Filesdd40abaa0c89e0efe49914806ec120b19384763e /src
syndamia.com-80d2ff6ad5047e01388a451d0ce3fbe104195b65.tar
syndamia.com-80d2ff6ad5047e01388a451d0ce3fbe104195b65.tar.gz
syndamia.com-80d2ff6ad5047e01388a451d0ce3fbe104195b65.zip
Parent2baec5c780378429ee0e5e4d91e873322581eb48 (diff)
[talks/lbs] Minor formatting modifications to shell slides
1 files changed, 10 insertions, 13 deletions
-rw-r--r--src/talks/linuxgraphy-by-strabo/index.md23
diff --git a/src/talks/linuxgraphy-by-strabo/index.md b/src/talks/linuxgraphy-by-strabo/index.md
index f5748c6..10b2aea 100644
--- a/src/talks/linuxgraphy-by-strabo/index.md
+++ b/src/talks/linuxgraphy-by-strabo/index.md
@@ -792,24 +792,24 @@ Most modern shells support a lot of the more defying features of the [Bourne She
command [args...] &
```
- + `Ctrl+z`: suspend (stop but leave in the background) the currently running (foreground) job
+ + `Ctrl+z`: suspend the currently running (foreground) job
+ `bg`: start a suspended job in the background
+ `fg`: resume the last job to be put in the background and make it the current job with which we're interacting
+ `jobs`: list all active (background) jobs
-&&/slide
+&&/clide
&&clide
-- continuation
- + Every job is identified with a Job ID (number), which you can use by prepending a percentage sign. Example, to resume the job with JID 4:
+- &emsp;
+ + Every job is identified with a **Job ID** (number), which you can use by prepending a percentage sign. Example, to resume the job with JID 4:
```
fg %4
```
- + For managing everything, usually there is a job table.
+ + For managing everything, usually there is a *job table*.
Upon shell termination, the shell tells all jobs in that table to terminate and waits for them.
`disown`: remove a job from the job table
+ `kill`: send a signal to the process or job. Then that process will have to handle it accordingly.
@@ -819,7 +819,7 @@ Most modern shells support a lot of the more defying features of the [Bourne She
-&&slide &&font27
+&&clide &&font27
- [heredoc](https://en.wikipedia.org/wiki/Here_document): File literal, meaning it is a user "string" which is interpreted as a file
+ start with `<< NAME`, where NAME can be anything you want, it is used to mark the beginning and end of a heredoc. `<<` is also a redirection symbol
@@ -837,11 +837,9 @@ Most modern shells support a lot of the more defying features of the [Bourne She
- control operators: Control what command is executed, depending on [exit status](https://en.wikipedia.org/wiki/Exit_status)
+ `expr1 && expr2`: Run expr2, only if expr1 exited successfully
+ `expr1 || expr2`: Run expr2 if expr1 exited unsuccessfully
- + `expr1 ; expr2`: Run expr2 after expr1 finished (no matter how)
- + Every program returns an exit status (number) to the shell, zero being a successful closing, and all others indicating failure.
-
-&&/font &&/slide
+ + `expr1 ; expr2`: Run expr2 after expr1 (sequential execution)
+&&/font &&/clide
&&clide &&font27
@@ -855,7 +853,7 @@ Most modern shells support a lot of the more defying features of the [Bourne She
cat <<< "Hello World!"
```
- + Standard input, standard output and standard error are all files with which the shell works.
+ + **Standard input**, **standard output** and **standard error** are all **files** with which the shell works.
Typing text in the shell puts it into stdin, command output are put into stdout (and shown to the user) and errors are put into stderr (also shown to the user).
Each one of them is numbered from 0 to 2, and you can specify redirection by appending or prepending it to the redirection symbol.
* `N>outputfile`: redirects the output from standard stream N into outputfile
@@ -892,10 +890,9 @@ Most modern shells support a lot of the more defying features of the [Bourne She
&&slide
-- [scripting support](https://en.wikipedia.org/wiki/Shell_script): Rather than running a series of commands manually, you can put them all in a file and run that
+- [scripting support](https://en.wikipedia.org/wiki/Shell_script): Running commands from top to bottom of a file
+ `#`: Everything between a # and the end of the line denotes a comment
+ `#!`: If on the first line of the file, is treated as a [shebang](https://en.wikipedia.org/wiki/Shebang_%28Unix%29), which specifies what interpreter to be used for the script
- + Each command (line) is executed in series, from top to bottom
- compound commands: Shells also often offer more advanced structured, with which to more easily write complex expressions