Main index

Introducing UNIX and Linux


Getting started

Overview
Using UNIX
      Usernames
      Logging in
Logging out
Commands
      Typing in commands
      Commands and options
Communication with other users
      Email
      Other communication facilities
Files
      The editor Vi
            Vi commands (command mode)
            Vi commands (colon mode)
      Other editors
Input and output
      Scripts
      Here-documents
      Pipes
      Making copies of input and output
      Pagers
Emergencies
Getting help
Summary
Exercises

Answer to chapter 4 question 5

The first decision to be made is which command to use to display the machine's users. Use man with a suitable keyword:

man -k logged
   ...
who (1) - show who is logged on
   ...

The script should therefore echo the one-line message and then run who:

echo "The following are logged in:"
who

Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck