Skip to content

Commit 7097d7d

Browse files
committed
questions answered
1 parent e728a97 commit 7097d7d

File tree

1 file changed

+84
-30
lines changed

1 file changed

+84
-30
lines changed

notes/2023-10-24.md

Lines changed: 84 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ important_classes.py
500500
setup.py
501501
```
502502

503+
And this is as `ls` except without the folders:
503504

504505
```{code-cell} bash
505506
:tags: ["skip-execution"]
@@ -513,24 +514,19 @@ LICENSE.md docs setup.py
513514
README.md filecheck.sh tests
514515
```
515516

517+
```{important}
518+
We also looked at the structure and some examples of the action files in the KWL repo and course website.
516519
517-
```{code-cell} bash
518-
:tags: ["skip-execution"]
519-
cd ../fall2023/
520-
```
521-
522-
```{code-block} console
520+
I recommend the docs, starting from the [quickstart](https://docs.github.com/en/actions/quickstart) and the [understand section](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions)
523521
```
524522

523+
## Using GH
525524

526525
```{code-cell} bash
527526
:tags: ["skip-execution"]
528-
gh repo view --web
527+
cd ../fall2023/
529528
```
530529

531-
```{code-block} console
532-
Opening github.com/introcompsys/fall2023 in your browser.
533-
```
534530

535531

536532
```{code-cell} bash
@@ -549,6 +545,7 @@ Showing 5 of 5 open pull requests in introcompsys/fall2023
549545
#5 Added question to 9 26 n... NoahV17:added-question-t... about 23 days ago
550546
```
551547

548+
Grep can search content, so with a pipe we can use it to filter results.
552549

553550
```{code-cell} bash
554551
:tags: ["skip-execution"]
@@ -559,13 +556,27 @@ gh pr list | grep sample
559556
12 sample proposals for 212 docs build 212build OPEN 2023-10-14 17:02:14 +0000 UTC
560557
```
561558

559+
## Terminal coloring and customizing your prompt.
560+
561+
Your path settings, aliases, and the your prompt can be set with a file.
562+
563+
On MacOS the file is called `.bash_profile` and is stored at your `~` home directory. If you use `zsh` instead of bash there is a different file, but it is similar.
564+
565+
On linux it is `.bashrc` it should be the same in WSL on Windows.
566+
567+
```{admonition} Community Badge opportunity
568+
If you use windows, can you PR to update these notes with what file is used and which terminal/shell you are using (bash via GitBash, powershell, bash in WSL, etc. )
569+
```
562570

563571
```{code-cell} bash
564572
:tags: ["skip-execution"]
565573
cat ~/.bash_profile
566574
```
567575

568-
## Terminal coloring and customizing your prompt.
576+
577+
I have some aliases set, this way when I use Python, I can use the `python` command instead of `python3`.
578+
579+
the `PS1` variable describes the main default prompt, according to [the spec](https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html). [this tool can help you customize your prompt](https://bash-prompt-generator.org/)
569580

570581
```{code-block} console
571582
alias pip=pip3
@@ -591,43 +602,86 @@ unset __conda_setup
591602
```
592603

593604

594-
```{code-cell} bash
595-
:tags: ["skip-execution"]
596-
pwd
605+
606+
607+
## Prepare for Next Class
608+
609+
```{include} ../_prepare/2023-10-26.md
597610
```
598611

599-
```{code-block} console
600-
/Users/brownsarahm/Documents/inclass/systems/fall2023
612+
## Review Badge
613+
614+
```{include} ../_review/2023-10-24.md
601615
```
602616

603617

604-
```{code-cell} bash
605-
:tags: ["skip-execution"]
618+
## Practice Badge
606619

620+
```{include} ../_practice/2023-10-24.md
607621
```
608622

609-
```{code-block} console
610623

611624

612-
## Prepare for Next Class
625+
## Experience Report Evidence
613626

614-
```{include} ../_prepare/2023-10-24.md
615-
```
627+
## Questions After Today's Class
616628

617-
## Review today's class
629+
### How often will we be writing scripts for this class?
618630

619-
```{include} ../_review/2023-10-24.md
620-
```
631+
Just a few times to get practice and exposure, but they will come back in 412 and are handy in general.
621632

633+
### Are bash scripts commonly used today in real world applications or is it something that was used more in the 70s?
622634

635+
They are still super common. GitHub actions can be written using bash scripting as a strategy. Lots of systems have build scripts.
623636

624-
## More Practice
637+
The thing we would not do that often that we did today was write it from nano instead of a full IDE.
625638

626-
```{include} ../_practice/2023-10-24.md
627-
```
639+
### What is the scope of loop variables?
628640

641+
In bash the loop variable has the same scope as any other variable. It is the same in Python. This is one of the many features that can very from language to language.
629642

643+
### When would I use bash instead of a different programming language?
630644

631-
## Experience Report Evidence
645+
When you need to do things that are file operations or other os level actions, it can be faster to run if it is in bash.
646+
647+
### What specific tasks do developers like to use bash to automate?
648+
649+
build processes, file manipulations, git operations. Anything even just a few steps that would be repetitive and you would have to do often.
650+
651+
### do people write full programs in bash using things like nano or directly into the terminal?
652+
653+
Yes! Some people especialy people who started programming a long time ago still do.
654+
655+
More often, using a terminal text editor is a handy tool to use on occasion, but not for every day work. We will work on a remote server, which is an occasion you would use that, on Thursday.
656+
657+
### Is there a way to save files that you create in the shell?
658+
659+
yes, today we saved the filecheck.sh file.
660+
661+
### what else can we do with bash?
662+
663+
Its mostly for automating things and processing files or outputs.
664+
665+
It *can* do anything though.
666+
667+
### Does running a bash script with `bash <filename>`` remove the need to add #!/bin/bash to the top of it and then make it executable prior to running?
668+
669+
Yes. by running it like `bash <filename` it works just like passing those lines in the file to bash.
670+
671+
Alternatively you can put the shebang `#!/bin/bash` at the top to tell the computer what shell to use to run it and then treat it as an executable.
672+
673+
We will learn about making it executable permissions wise on Thursday.
674+
675+
676+
### Is it possible to create functions in bash scripts?
677+
678+
Yes! [see the GNU bash docs on functions](https://www.gnu.org/software/bash/manual/html_node/Shell-Functions.html)
679+
680+
681+
### Where would we see bash the most as a developer? Would we use this language more for an embedded swe role or is it something that's present in every type of programming job.
682+
683+
I think it's present in just about any programming job. You will always need to work with files at times, you will alwasy have repetitive things that you do not want to do manually. You may write more or less, but it's alwasy a handy tool to have.
684+
685+
### Where could I learn more about writing something similar to the workflows we saw?
632686

633-
## Questions After Today's Class
687+
The [github actions documentation](https://docs.github.com/en/actions) has instructions with how tos, API like documentation, and examples.

0 commit comments

Comments
 (0)