Today we learned a shortcut in Lab46, begin typing file or directory and press tab and it will appear. Learned AND, OR are binary functions and NOT is a unary function. Also learned a little on regular expressions.
Learned a little about C programming, programming paradigms: Paradigm includes structured; Functional; Logical; object - oriented. Discussed Source code portable and Binary Portability
Source code --- syntax checking,syntax evaluation, pre-processor --- compile/interpret --- assembly --- assembler --- linker --- binary
We talked about processes (programs in action)
ps - process status top - show currently active processes pid - process id
We talked about signals, and killed many cats in various odd yet specific ways. We used:
kill-1 kill-2 kill-3 kill-4 kill-7
Played with grep, sed, and cut
ps aux | grep irssi | wc -l -counts how many irrssi ps aux | grep irssi | grep -v grep | wc -l -counts how many irssi with out grep in it ps aux | grep irrssi | grep -v grep | sed 's/ */ /g' - removes all spaces ps aux | grep irrssi | grep -v grep | sed 's/ */ /g' | cut -d' ' -f1,5 -cuts out lines except 1 and 5
variables (environment/local)
Environment variable - within the shell, a variable that is stored in the environment. Because the environment is inherited by all child processes, environment variables can be thought of as global variables. However, they are not strictly global, because changes made by the child are not propagated back to the parent. Local Variable - A variable that exists only within the scope in which it was created. For example. within the shell, a variable that is not part of the environment is a local variable.
wildcards
wildcards are used in unix and other operating systems when searching for files or directory’s. some of the most common wildcards are the * and ?. The asterisk is used to represent any number of unknown characters. For example if you typed in file* you may receive a number of files beginning with file… file1.txt, file2.txt, fileboy.txt, fileoctopus.txt. Note that the .txt has nothing to do with it it is just a file name extension. The ? make on the other hand only represents one unknown character so if you typed in file? you will only receive file names such as file.txt, file1.txt, file2.txt but now files with more than one extra character after the name file.
Using wildcards to count how many files or directory with certain characters:
lab46:~$ ls ??? | wc -l 2 lab46:~$ ls ??* | wc -l 83 lab46:~$ ls -d *[aeiou] | wc -w 2
What is the question you'd like to pose for experimentation? State it here.
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
How are you going to test your hypothesis? What is the structure of your experiment?
Perform your experiment, and collect/document the results here.
Based on the data collected:
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.