updates
This commit is contained in:
parent
cf0477a4af
commit
21f0424e48
2 changed files with 56 additions and 21 deletions
|
|
@ -7,7 +7,6 @@
|
||||||
#+attr_html: :class links
|
#+attr_html: :class links
|
||||||
- [[../toc.org][TOC | Missing Semester]]
|
- [[../toc.org][TOC | Missing Semester]]
|
||||||
- [[https://www.youtube.com/playlist?list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J][Playlist: Missing Semester]]
|
- [[https://www.youtube.com/playlist?list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J][Playlist: Missing Semester]]
|
||||||
- current: https://youtu.be/Z56Jmr9Z34Q?si=t9wQkGXDznscDtNH&t=1217
|
|
||||||
|
|
||||||
*** timestamps
|
*** timestamps
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
|
|
||||||
|
|
@ -14,22 +14,22 @@
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+attr_html: :class playlist
|
#+attr_html: :class playlist
|
||||||
1. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=54s][control flow functions]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=54s][00:54 - control flow functions]]
|
||||||
2. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=227s][sequential execution]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=227s][03:47 - sequential execution]]
|
||||||
3. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=425s][standard input]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=425s][07:05 - standard input]] *current*
|
||||||
4. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=444s][error code]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=444s][07:24 - error code]]
|
||||||
5. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=517s][logical operators]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=517s][08:37 - logical operators]]
|
||||||
6. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=603s][concatenate commands]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=603s][10:03 - concatenate commands]]
|
||||||
7. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=645s][common substitution]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=645s][10:45 - common substitution]]
|
||||||
8. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=675s][process substitution]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=675s][11:15 - process substitution]]
|
||||||
9. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=935s][comparison operator]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=935s][15:35 - comparison operator]]
|
||||||
10. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1173s][curly braces]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1173s][19:33 - curly braces]]
|
||||||
11. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1359s][python script]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1359s][22:39 - python script]]
|
||||||
12. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1707s][man command]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1707s][28:27 - man command]]
|
||||||
13. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2175s][finding files]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2175s][36:15 - finding files]]
|
||||||
14. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2190s][grep]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2190s][36:30 - grep]]
|
||||||
15. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2573s][fuzzy finder]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2573s][42:53 - fuzzy finder]]
|
||||||
16. [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2649s][history substring search]]
|
+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2649s][44:09 - history substring search]]
|
||||||
|
|
||||||
* Notes
|
* Notes
|
||||||
|
|
||||||
|
|
@ -42,13 +42,12 @@
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
- this doesn't:
|
- this doesn't:
|
||||||
|
|
||||||
#+begin_src bash
|
#+begin_src bash
|
||||||
foo = bar
|
foo = bar
|
||||||
echo $foo
|
echo $foo
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
the output of that will be
|
- the output of that will be
|
||||||
=zsh: command not found: foo=
|
=zsh: command not found: foo=
|
||||||
|
|
||||||
- what happens in the above example is that we are effectively calling the "foo" program with the arguments: "=" and "bar"
|
- what happens in the above example is that we are effectively calling the "foo" program with the arguments: "=" and "bar"
|
||||||
|
|
@ -76,3 +75,40 @@
|
||||||
|
|
||||||
will return: =Value is $foo=
|
will return: =Value is $foo=
|
||||||
|
|
||||||
|
** sequential execution
|
||||||
|
|
||||||
|
*** bash functions
|
||||||
|
- mcd.sh
|
||||||
|
#+begin_src bash
|
||||||
|
mcd() {
|
||||||
|
mkdir -p "$1"
|
||||||
|
cd "$1"
|
||||||
|
}
|
||||||
|
#+end_src bash
|
||||||
|
|
||||||
|
- creates a function that can be executed after loading
|
||||||
|
- $1 is a global variable referring to the first parameter
|
||||||
|
|
||||||
|
*** source
|
||||||
|
- using source mcd.sh
|
||||||
|
=source mcd.sh=
|
||||||
|
|
||||||
|
- then carry out the function
|
||||||
|
=mcd testdir=
|
||||||
|
|
||||||
|
- this will create a new directory and cd into it as per the definied functioned
|
||||||
|
|
||||||
|
*** variables
|
||||||
|
- $0 -- name of the script we are currently in
|
||||||
|
- if you run this in the shell it will display 'bash'
|
||||||
|
- $1->$9 -- the first through ninth argument given to a script
|
||||||
|
- $? -- the last error message
|
||||||
|
- $_ --- last argument of the previous call
|
||||||
|
|
||||||
|
- !! -- recreates the last call with it's arguments
|
||||||
|
- use with sudo if you found your call needed a sudo and you don't feel like retyping it again
|
||||||
|
|
||||||
|
#+begin_src bash
|
||||||
|
ls -lah
|
||||||
|
sudo !!
|
||||||
|
#+end_src
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue