Skip to content
Snippets Groups Projects
Commit de488262 authored by Nathan Meyer's avatar Nathan Meyer
Browse files

Commit for lab 2

parents
No related branches found
No related tags found
No related merge requests found
1. Move the cursor to this line.
2. Press v and move the cursor to the fifth item below. Notice that the
text is highlighted.
3. Press the : character. At the bottom of the screen :'<,'> will appear.
4. Type w TEST , where TEST is a filename that does not exist yet. Verify
that you see :'<,'>w TEST before you press <ENTER>.
5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls
to see it. Do not remove it yet! We will use it in the next lesson.
#!/bin/bash
echo "I have no idea."
milk
cookies
1. Output of `ls -al`
nim28@tux2 ~> ls -al
total 28
drwx--x--x 7 nim28 nim28 1968872 Oct 4 14:06 .
drwxr-xr-x 239 root root 56759519941 Sep 20 14:17 ..
-rw------- 1 nim28 nim28 2272 Oct 4 13:49 .bash_history
-rw-r--r-- 1 nim28 nim28 220 Apr 3 2012 .bash_logout
-rw-r--r-- 1 nim28 nim28 1138 Oct 4 14:05 .bashrc
drwx------ 2 nim28 nim28 0 Sep 28 2018 .cache
-rw-r--r-- 1 nim28 nim28 73 Sep 27 14:52 .exrc
-rw-r--r-- 1 nim28 nim28 17 Sep 26 2018 .forward
-rw-rw-r-- 1 nim28 nim28 79 Sep 27 14:25 .gitconfig
drwx------ 3 nim28 nim28 0 Jan 25 2019 .gnupg
-rw-r--r-- 1 nim28 nim28 391 Sep 27 14:53 .inputrc
-rw-r--r-- 1 nim28 nim28 832 Sep 27 14:52 .mailrc
drwxrwxr-x 2 nim28 nim28 0 Sep 28 2018 .nano
-rw-rw-r-- 1 nim28 nim28 186 Sep 28 2018 .nanorc
-rw-r--r-- 1 nim28 nim28 675 Apr 3 2012 .profile
drwxrwxr-x 12 nim28 nim28 1943207 Sep 27 14:00 public_html
drwx------ 2 nim28 nim28 4506 Sep 27 14:39 .ssh
-rw-r--r-- 1 nim28 nim28 767 Sep 27 14:52 .tmux.conf
-rw------- 1 nim28 nim28 9633 Oct 4 14:06 .viminfo
-rw-r--r-- 1 nim28 nim28 4876 Oct 4 14:02 .vimrc
2. CHMOD * 644
\ No newline at end of file
milk
cookies
This diff is collapsed.
Subject: Bread is Dangerous
(Compare this to 'Speed Kills', 'A Child is Reported Missing' and other
'statistics show I'm right' arguments by experts.)
Bread Is Dangerous
Important Warning for those who have been drawn unsuspectingly
into the use of bread:
1. More than 98 percent of convicted felons are bread users.
2. Fully HALF of all children who grow up in bread-consuming
households score below average on standardized tests.
3. In the 18th century, when virtually all bread was baked in
the home, the average life expectancy was less than 50 years;
infant mortality rates were unacceptably high; many women died in
childbirth; and diseases such as typhoid, yellow fever, and
influenza ravaged whole nations.
4uffocate a
in one month
6. Primiti
incidence of
osteoporosis
7. Bread h
bread and gi
little as tw
8. Bread i
"harder" ite
cold cuts.
9. Bread h
is more than
lead to your
product, tur
roven that as little as one pound of dough can be used to
suffocate a mouse. The average American eats more bread than that
in one month!
6. Primitive tribal societies that have no bread exhibit a low
incidence of cancer, A. More than 90 percent of violent crimes are committed within
24 hours of eating bread.
5. Bread is made from a substance called "dough." It has been
proven that as little as one pound of dough can be used to
suffocate a mouse. The average American eats more bread than that
in one month!
6. Primitive tribal societies that have no bread exhibit a low
incidence of cancer, Alzheimer's, Parkinson's disease, and
osteoporosis.
7. Bread has been proven to be addictive. Subjects deprived of
bread and given only water to eat begged for bread after as
little as two days.
8. Bread is often a "gateway" food item, leading the user to
"harder" items such as butter, jelly, peanut butter, and even
cold cuts.
9. Bread has been proven to absorb water. Since the human body
is more than 90 percent water, it follows that eating bread could
lead to your body being taken over by this absorptive food
product, turning you into a soggy, gooey bread-pudding person.
10. Newborn babies can choke on bread.
11. Bread is baked at temperatures as high as 400 degrees
Fahrenheit! That kind of heat can kill an adult in less than one
minute.
12. Most American bread eaters are utterly unable to distinguish
between significant scientific fact and meaningless statistical
babbling.
In light of these frightening statistics, we propose the
following bread restrictions:
1. No sale of bread to minors.
2. A nationwide "Just Say No To Toast" campaign, complete with
celebrity TV spots and bumper stickers.
3. A 300 percent federal tax on all bread to pay for all the
societal ills we might associate with bread.
4. No animal or human images, nor any primary colors (which may
appeal to children) may be used to promote bread usage.
5. The establishment of "Bread-free" zones around schools.
Q1:
nim28@tux2 CS265> echo 'milk' > list
nim28@tux2 CS265> echo 'cookies' >> list
nim28@tux2 CS265> echo '#!/bin/bash' > Tmp/gotMe.bash
nim28@tux2 CS265> echo -e '\necho "I have no idea."' >> Tmp/gotMe.bash
nim28@tux2 CS265> find . -type f -mtime -2 -print
./GitLab/lab02/lab02
./GitLab/lab01/Tmp/gotMe.bash
./GitLab/lab01/Tmp/list
./GitLab/lab01/list
./GitLab/lab01/lab01.txt
Q2:
find . -type f -name *.bash
Q3:
nim28@tux2 lab02> cp ~kschmidt/public_html/CS265/Labs/Bash/breadIsDangerous.txt ./breadIsDangerous.txt
nim28@tux2 lab02> wc ./breadIsDangerous.txt
97 499 2960 ./breadIsDangerous.txt
nim28@tux2 lab02> ls -1 | wc -l
2
Q4:
ls -1 | wc -l
Q5:
nim28@tux2 lab02> grep -o bread breadIsDangerous.txt
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
Q6:
nim28@tux2 lab02> grep -o bread breadIsDangerous.txt | wc -l
21
\ No newline at end of file
17
24
1
9
26
15
29
6
20
28
An extra line
I went to a garden party
This line is fine
bunch of my old friends did something
As is this one
I went to a gadren party
This line is fine
bnuch of my old freinds did somehting
As is this one
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment