Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use putty to write the code JUST write the question code is ok. Not include the script code (Q2) Practice: Grep (10 marks) To answer
use putty to write the code JUST write the question code is ok. Not include the script code
(Q2) Practice: Grep (10 marks) To answer this question, record the sequence of commands you perform using the script command as in Question 2 of the first assignment. To review how to use this command, refer to Question 2 of the first assignment or run man script on bluenose. Record your sequence of commands and their outputs in a file a2q2.log and put this file under subversion control. For each of the following questions, create a single pipeline of commands that produces the desired output. (a) Headlines in HTML documents are marked with, , ..., where the number indicates the level of the headline. Construct a pipeline using grep and one additional Unix command (you need to decide which one is right for the job) to count how many headlines my CSCI 2132 course webpage contains. This webpage is stored in the file /users/webhomezeh/Teaching/2132/index.html on bluenose. (b) Use ls, grep, and wc to produce a list of all files in the /usr/bin directory on bluenose that are at least 10,000,000 bytes in size. (c) When you type ls at the shell prompt, this executes the /bin/ls program. To decide which program to run when you type ls instead of /bin/ls , the shell searches a number of directories to find a file with name 1s. It uses the first such file it finds. These directories are stored in your shell's environment variable SPATH. The list of environment variables your shell knows about and their values can be listed using the env command. Use env and grep to list the contents of your $PATH environment variable. Provide the right command line options to grep to ensure you list only the $PATH variable. (d) Find all words in the file/usr/share/dict/linux.words on bluenose that contain 20 or more vowels. (e) Count how many words there are in /usr/share/dict/linux, words that start with a "b" or "p and end in "ing" (Q2) Practice: Grep (10 marks) To answer this question, record the sequence of commands you perform using the script command as in Question 2 of the first assignment. To review how to use this command, refer to Question 2 of the first assignment or run man script on bluenose. Record your sequence of commands and their outputs in a file a2q2.log and put this file under subversion control. For each of the following questions, create a single pipeline of commands that produces the desired output. (a) Headlines in HTML documents are marked with , , ..., where the number indicates the level of the headline. Construct a pipeline using grep and one additional Unix command (you need to decide which one is right for the job) to count how many headlines my CSCI 2132 course webpage contains. This webpage is stored in the file /users/webhomezeh/Teaching/2132/index.html on bluenose. (b) Use ls, grep, and wc to produce a list of all files in the /usr/bin directory on bluenose that are at least 10,000,000 bytes in size. (c) When you type ls at the shell prompt, this executes the /bin/ls program. To decide which program to run when you type ls instead of /bin/ls , the shell searches a number of directories to find a file with name 1s. It uses the first such file it finds. These directories are stored in your shell's environment variable SPATH. The list of environment variables your shell knows about and their values can be listed using the env command. Use env and grep to list the contents of your $PATH environment variable. Provide the right command line options to grep to ensure you list only the $PATH variable. (d) Find all words in the file/usr/share/dict/linux.words on bluenose that contain 20 or more vowels. (e) Count how many words there are in /usr/share/dict/linux, words that start with a "b" or "p and end in "ing
, , ..., where the number indicates the level of the headline. Construct a pipeline using grep and one additional Unix command (you need to decide which one is right for the job) to count how many headlines my CSCI 2132 course webpage contains. This webpage is stored in the file /users/webhomezeh/Teaching/2132/index.html on bluenose. (b) Use ls, grep, and wc to produce a list of all files in the /usr/bin directory on bluenose that are at least 10,000,000 bytes in size. (c) When you type ls at the shell prompt, this executes the /bin/ls program. To decide which program to run when you type ls instead of /bin/ls , the shell searches a number of directories to find a file with name 1s. It uses the first such file it finds. These directories are stored in your shell's environment variable SPATH. The list of environment variables your shell knows about and their values can be listed using the env command. Use env and grep to list the contents of your $PATH environment variable. Provide the right command line options to grep to ensure you list only the $PATH variable. (d) Find all words in the file/usr/share/dict/linux.words on bluenose that contain 20 or more vowels. (e) Count how many words there are in /usr/share/dict/linux, words that start with a "b" or "p and end in "ing
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started