Roses are red
Violets are blue;
Don’t you hate it
When stuff doesn’t rhyme?
Now create a file called breakit. Enter the following script in it:
while read input
for word in $input
Execute the script with poem.txt as input:
./breakit < poem.txt
Compare the results of your breakit script with the results of this command:
tr ‘ ‘ ‘\n’ < poem.txt
The first part of that is tr SPACE apostrophe SPACE apostrophe SPACE, and those are apostrophes around \n.
Both commands produce similar output. Are they doing the same thing? Explain.
2. On the class server, try these two commands (use the poem.txt file you created for question #1 as your text file here):
this command expr `cat poem.txt | wc –c` / `cat poem.txt | wc –l` evaluates a
this command expr `wc –c poem.txt` / `wc –l poem.txt` doesn't work
Why does one work and the other doesn’t? What are these commands both doing? Explain each in detail.
3. On the class server, set the following variable:
Now check its value:
Launch a new bash subshell by typing in bash and hitting enter.
Once you’ve launched the subshell, try this command again:
What happened? Why? What would you need to do to make this work? Show the command it would take to make echo $sunset work in both cases.
4. On the class server, use this command to set up an alias:
alias ghist=‘history | grep’
Once it’s set, use it with various commands that you know, like:
What kind of output do you get when trying this with different commands? What is the ghist alias doing when combined with different commands? Explain.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.
By purchasing this solution you'll be able to access the following files: