Upcoming Events

Cloud Connect
Santa Clara
Feb 13-16, 2012

Cloud Connect brings together the entire cloud eco-system to better understand the transformation we're experiencing and promises to be the defining event of the cloud computing industry. Learn about the latest cloud technologies and platforms from thought leaders in Cloud Connect’s comprehensive conference.

Register Now!

More Events »

Subscribe to Newsletter

  • Keep up with all of the latest news and analysis on the fast-moving IT industry with Network Computing newsletters.
Sign Up


Using the Unix Shell: Listings

Figure 1. A computer system is composed of layers of hardware and software

+----------------+-------------------------------------------------+
|                |                                                 |
|       Shell    |               Application Programs              |
|                |                                                 |
|----------------+-------------------------------------------------+
|                                                                  | 
|                     Operating Sytem Kernel                       |
|                                                                  |
+------------------------------------------------------------------+
|                                                                  |
|                             Hardware                             |
|                (CPU, Memory, and Peripheral Devices)             |
|                                                                  |
+------------------------------------------------------------------+

Listing 1. Resetting the shell prompt

A. Reset the Bourne shell prompt by changing the PS1 shell variable:

$ PS1 = "Yes, Master? "
            
Yes, Master?  []

B. Reset the C shell by resetting the prompt variable:

$ set prompt = Yes, Master? "
Yes, Master? []

Listing 2. A general format for a UNIX system command

$ command_name [ option... ] [ filename... ]

Listing 3. Some Bourne shell error messages

A. Mistype a command name:

$ pws
pws: not found
$ []

B. Attempt to run a restricted command:

$ /etc/shutdown
/etc/shutdown: cannot execute
$ []

Listing 4. Equivalent C shell error messages

A. Mistype a command name:

% pws
pws: Command not found.
% []

B. Attempt to run a restricted command:

% /etc/shutdown
/etc/shutdown: Permission denied.
% []

Listing 5. Use the & directive to run a command in the background.

$ nroff -mm text.mm >text.fmt &
Print This Page


e-mail Send as e-mail

Research and Reports

Hypervisor Derby
August 2011

Network Computing: August 2011

TechWeb Careers