IMG_7072

.png

School

Macomb Community College *

*We aren’t endorsed by this school

Course

1710

Subject

Computer Science

Date

Jul 2, 2024

Type

png

Pages

1

Uploaded by AgentTeamGiraffe39

162 Chapter 8: Specifying Instructions to the Shell 0 10 MINUTES Lab Exercise 8.06: Gathering Error Numbers With redirection error, LaTrina can now implement all of the error checks, and check her own log file for messages. This will allow her to customize the program to trap every error the user generates. In time, her regist.exe will be crash-proof. She asks you how she can get the error codes for common UNIX errors. She knows what errors she is getting, but without the error codes she cannot program for the errors. You tell her about the $? variable, which holds the error code for the previous error. Learning Objectives In this lab, you will record error numbers for common commands. By the end of this lab, you'll be able to: e Determine the error code for any UNIX error Lab Materials and Setup The materials you need for this lab are: e Computer with Red Hat Linux 7.3 installed ® Pencil and paper Getting Down to Business The following table has several commands. Run the command and get the error number using the $? variable. Record the error number in the space provided. Recall that you will need to echo this variable to get the contents. You will have to apply the knowledge that you acquired in the Introduction to UNIX and Linux textbook by John Muster (McGraw-Hill/Osborne, 2002) for echoing variable contents. ¥ Warning Do not log in as root to run this exercise!
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help