diff --git a/_subsections/lesson-02.org b/_subsections/lesson-02.org index 6c18dea..f715af3 100644 --- a/_subsections/lesson-02.org +++ b/_subsections/lesson-02.org @@ -8,7 +8,7 @@ - [[../toc.org][TOC | Missing Semester]] - [[https://www.youtube.com/playlist?list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J][Playlist: Missing Semester]] -- Curr: https://youtu.be/kgII-YWo3Zw?si=Hy3Vic8blG1mOc7F&t=1357 +- Curr: https://youtu.be/kgII-YWo3Zw?si=Wm8KLT1ggOGG8W-g&t=1692 *** timestamps @@ -27,8 +27,8 @@ + [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=675s][11:15 - process substitution]] + [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=935s][15:35 - comparison operator]] + [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1173s][19:33 - curly braces]] -+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1359s][22:39 - python script]] *current* -+ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1707s][28:27 - man command]] ++ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1359s][22:39 - python script]] ++ [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=1707s][28:27 - man command]] *current* + [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2175s][36:15 - finding files]] + [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2190s][36:30 - grep]] + [[https://www.youtube.com/watch?v=kgII-YWo3Zw&t=2573s][42:53 - fuzzy finder]] @@ -253,3 +253,30 @@ this takes the format {1..20} #+begin_src bash touch directory{1..4}/foo{a..z}.txt #+end_src + +** python scripts +*** making them bash executable +- reference the python compiler at the top of the file + - do it directly: + #+begin_src bash + #!/usr/local/bin/python + #+end_src + - use the env program to do so + #+begin_src bash + #!/usr/bin/env python + #+end_src + +*** args can be found through sys.argv[1:] + #+begin_src python +import sys +for arg in reversed(sys.argv[1:]): + print(arg) + #+end_src + +** checking for problems in bash scripts using 'shellcheck' +#+begin_src bash +shellcheck some_bash_script.sh +#+end_src + +- will tell you problems +- and warnings