[comment]: # "markdown: { smartypants: true }" Warning: Live Editing Mac-centered Part 1 & 1.5 of 3 --- ## Scripting ## & ## Interactive Shell --- ## Interactive Shell # vs ## Scripting --- **Fish** (Interactive Shell) --- **Posix Shell** (Scripting) --- The _NOT_-Bash Parts (Learn to *Un*learn) --- ### Focus - Web Development (& Dev Ops) - Know where to start (and stop) - Interpret Feedback - Write Clean Scripts (modules, etc) --- ### Part 1, 2, & 3 --- # Interactive Shell --- - Small Brain Paradox - First Encounter - Not Errors - The Tools Make The Man - Understanding Makes The Man - vi... also makes the man - Useful commands --- ## -1. Small Brain --- 1.
2. `shell-cheatsheet` 3. Desc, README, n/a, MPL
github.com/BeyondCodeBootcamp/shell-cheatsheet
--- ````md # Goal: Install dev tools A short summary of what we'll do / did. 1. I did this: ```sh # install xcode command line tools xselect --install ``` 2. I did that ```sh # install xcode command line tools xselect --install ``` ````
github.com/BeyondCodeBootcamp/shell-cheatsheet
--- ## 0. First Encounter (how to recover) --- 1. Open the Terminal _thing_ 2. Bang on Keyboard 3. TREL the REPL 4. Recover --- Open Terminal Bang on Keyboard --- 1.
Ctrl
+
C
\ Cancel --- 2. `reset` \ fix jank --- 3.
Cmd
+
K
\ **or**
Ctrl
+
L
: \ KLear the KonsoLe --- 4.
Ctrl
+
D
\ **D**one (en**D**) --- 5. Close and Re-Open Terminal --- Repeat
Ctrl
+
C
• `reset` •
Cmd
+
K
/
L
•
Ctrl
+
D
• Re-Open
---
Ctrl
+
C
• `reset` •
Cmd
+
K
/
L
•
Ctrl
+
D
• Re-Open
```text Hello World! # whatever you want It's my birthday ```
TREL: Try, Read, Evaluate, Loop
---
Ctrl
+
C
• `reset` •
Cmd
+
K
/
L
•
Ctrl
+
D
• Re-Open
```text echoHelloWorld! echo Hello World! echo Hello World! echo ' Hello World! ' Echo ‘hello world’ sudo echo Hello World! type echo Hello World! ```
(this _should_ all work)
---
Ctrl
+
C
• `reset` •
Cmd
+
K
/
L
•
Ctrl
+
D
• Re-Open
```text time sudo echo Hello World! sudo time echo Hello World! echo sudo time Hello World! history sudo bash -c 'history' ```
(this _should_ all work too)
--- Anything Noteworthy? --- ## 1. Tools Make the Man ---  https://developer.apple.com/design/resources/ ---
---
--- ### OS-Level Dev Tools --- ```sh # Mac xcode-select --install ``` ```sh # Linux sudo apt install -y git vim curl zip ``` --- ### Webi, iTerm, & Rosetta --- Webi
```sh # Mac, Linux curl -sS https://webi.sh/ | sh ``` ```sh Windows curl.exe https://webi.ms/ | powershell ``` --- iTerm2
```sh # Mac, Linux curl -sS https://webi.sh/iterm2 | sh ``` --- Rosetta
--- Resetta
--- ### Fish ```sh command -v fish ``` ```sh webi fish ``` ```sh command -v fish ``` ```sh fish ``` --- ```sh command -v fish type fish command -v echo type echo ``` ---
--- ```text echo It's my birthday echo It's my birthday echo It\'s my birthday ``` --- ### Mo' Dev Tools, Mo' Betta' ```sh command -v jq ``` ```sh webi aliasman bat curlie \ fd fzf jq keypairs lsd \ rg sd serviceman ``` ```sh command -v jq ``` ```sh aliasman cat 'bat --style=plain --pager=none' aliasman ll 'lsd -lAhF' aliasman curl 'curlie' ``` ```sh type cat ``` --- ```sh pushd /tmp/ curl -o NOTES.md 'https://raw.githubusercontent.com/BeyondCodeBootcamp/shell-cheatsheet/main/README.md' cat NOTES.md ll ``` --- ### Rewriting History ```text fish exit command type echo ls curl sudo date mkdir time pushd popd git pwd ``` --- ```text history vi ``` --- ```sh webi nerdfont ``` (magic to change terminal font) ```sh ll ``` --- What to do? --- ## 2. Useful Commands --- ```sh git pushd popd cat curl jq ``` --- ## 3. Understanding Makes the Man --- ```sh ll git clone https://github.com/your-username/shell-cheatsheet ll pushd ./shell-cheatsheet/ ll popd ll pushd ./shell-cheatsheet/ ll ``` --- https://api.github.com/search/issues?q=type:pr+state:closed+author:coolaj86&per_page=100&page=1 --- Metasyntastic Variables https://datatracker.ietf.org/doc/html/rfc3092 ```text foobar quux foo corge bar grault baz garply qux waldo fred plugh my xyzzy your thud ``` https://en.wikipedia.org/wiki/Metasyntactic_variable --- ## 3. vi... also Makes the Man (pronounced "vim) --- ```sh ``` ---