User Tools

Site Tools


opus:fall2012:cgaines:part2

Part 2

Entries

Entry 1: October 10th, 2012

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.

Entry 2: October 12th, 2012

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

Entry 3: October 17, 2012

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

Entry 4: October 19th, 2012

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

Keywords

unix Keyword 2

variables (environment/local)

Definition

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.

References

  • Harley Hahn's Guide to Unix and Linux
  • Programming Logic and Design
  • Wikipedia

unix Keyword 2 Phase 2

wildcards

Definition

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.

References

Demonstration

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 

Experiment 2

Question

What is the question you'd like to pose for experimentation? State it here.

Resources

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.

Hypothesis

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.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

Data

Perform your experiment, and collect/document the results here.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
  • Was your hypothesis not applicable?
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
  • What shortcomings might there be in your experiment?
  • What shortcomings might there be in your data?

Conclusions

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.

opus/fall2012/cgaines/part2.txt · Last modified: 2012/10/31 22:12 by cgaines