Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Linux Shell Scripting (cloud9) Three files are needed: 1. commands.txt 2. split.cpp 3. printpaths.sh Instructions Use the shell to determine the number of executables in

Linux Shell Scripting (cloud9) image text in transcribed
Three files are needed:
1. commands.txt
2. split.cpp
3. printpaths.sh
Instructions Use the shell to determine the number of executables in the $PATH environment variable directories that contain the phrase "rm" This assignment should be completed by using a sequence of input and output redirected shell commands, a C++ program, and a shell script, in the following fashion: Output SPATH Split input by Output executable filepaths Search form in input Count instances of input variable Shell Command 1. The stream of data flows from left to right, beginning with a shell command that outputs the value of th 2. Instead of outputting to stdout, the output is redirected to the stdin of the C+t program (named C++ Program Shell Script Shell Command Shell Command $PATH environment variable to stdout (terminal window). split cpp) that splits a given string into multiple lines, using colon (:) as the separator The SPATH environment variable directories, now in separate lines, are sent to shell script (named printpaths. sh) which outputs the contents of each of the directories 4. Afterwards, a shell command filters the list of filepaths into ones that contain the phrase "rm". Finally, another shell command is used to count the number of' lines, which equals the number of executables in the SPATH environment variable directories that contain the phrase "rm" A single line of shell syntax should be used to combine and redirect all the data streams to produce the final result. Store the line into a text file named commands . txt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

Describe the job youd like to be doing five years from now.

Answered: 1 week ago

Question

So what disadvantages have you witnessed? (specific)

Answered: 1 week ago