Write a script that accepts a part of a process name

Assignment Help Programming Languages
Reference no: EM13749020

tput setaf color, where color is a number from 0 to 7 (try them out to see what colors they represent).

To return the terminal to its original color, you can use tput sgr0.

Using what we know about shell scripts, write a script that accepts a part of a process name as the first argument (like pgrep), which prints out the PID of all matching processes in blue, which is color code 4. Then print out the number of processes that matched in normal text.

If the user doesn't pass exactly one argument to the script, it should print out the following usage message and exit with a return code of 1:

Usage: scriptname pname
Displays all process IDs with image names matching pname.

Reference no: EM13749020

Questions Cloud

Why is process management necessary for an organization : Why is process management necessary for an organization and Discuss some of the key aspects to developing successful process and systems development projects
Explain trading amongst europe and africa : Explain Trading amongst Europe and Africa. Which had a great impact upon day to day life in Africa in the seventeenth through nineteenth centuries: Christianity, or trade with Europe and its colonies?
Case study on green mountain coffee roasters : Case Study on Green Mountain Coffee Roasters and Keurig Coffee
The long-standing mubarak regime in egypt : It would have been hard to miss the information had you been scanning the newspapers during the tumultuous February of 2011, when the long-standing Mubarak regime in Egypt was swept from power by a popular uprising ultimately aligned with the militar..
Write a script that accepts a part of a process name : Using what we know about shell scripts, write a script that accepts a part of a process name as the first argument (like pgrep), which prints out the PID of all matching processes in blue, which is color code 4. Then print out the number of proces..
Write an essay on the mexican war 1846-1848 : Write an essay on The Mexican War 1846-1848.
What do chinese artifacts reveal about chinas civilization : What do Chinese artifacts reveal about China's early civilization?
Imagine that the chief technology officer : Imagine that the Chief Technology Officer (CTO) of your organization, or of an organization in which you are familiar, has tasked you with researching the potential for using virtualization in the organization. You must write a report that the CTO an..
Write an essay on renaissance or gothic : Write an essay on Renaissance or Gothic. Explain how the works of art fit into the context of the time period. Keep in mind that only art works that fit into the period of Middle Ages-Renaissance will be accepted.

Reviews

Write a Review

Programming Languages Questions & Answers

  Hierarchy of processes

Write a program that creates a hierarchy of processes using the fork() system call.

  Write program using to take input two integers by while loop

Write a program which uses while loops to perform following steps: Prompts user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum).

  Creating session by granting needed privilege

Make sure that Bob can't create objects greater than 512K in size in USERS01 tablespace. And now that user is created, ensure that Bob can create session, by granting needed privilege.

  Program to display weekly payroll report

Write down a program to display a weekly payroll report.

  Program to find real and complex roots of quadratic equation

Write a VBA program to find the real and complex roots of the quadratic equation.

  Iimplement a class called monetarycoin

Create an implement a class called MonetaryCoin that is derived from the class Coin class. Store a value in the in the monetary coin that represents its value.

  Create script which checks day of the week

Create a script which checks day of the week, and takes one of two actions (step 2 or 3) depending on the day. If day is Monday through Friday, print (send to stdout) name of the day.

  Write program to operate as point of sale application

Write down program which will operate as the point of sale (POS) application at carpet retailer. Carpet will be sold by square yard. Padding will be sold by square yard.

  Learn to use some basic commands

In this lab you will learn to use some basic commands of the gedit, nano, and vim editors, with emphasis on vim.

  Application development and programming languages

Compare and contrast object-oriented languages (Java, C++, C#, etc.) to imperative languages (C, Pascal, etc.) in terms of:

  Show how the tree might be type-checked

Attempt to derive proof tree for the judgment Show how the tree might be type-checked

  Develop pseudo-code for program to retrieve bytes

Develop the pseudo-code for a program that will retrieve 2 bytes (NUM1 and NUM2) from memory, determine which is closest to the numeric value 50.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd