Vos Fundamentals
Vos Fundamentals
303
Student Guide
Stratus®
VOS Fundamentals
303
Student Guide
Stratus®
World-wide Customer Education
Stratus Technologies, Inc.
111 Powdermill Road
Maynard, MA USA 01754-3409
•
1-800-634-2122
[email protected]
hhtp://www2.stratus.com/education
Stratus® VOS Fundamentals 303
VOS Fundamentals
Course
303
This document outlines the essence of the material covered in this course.
This document is not intended to be used as a self-instructional guide. The rest of the
supporting knowledge will come from the lecture, demonstrations, labs, exercises and
student interaction. Students are encouraged to add their notes as the class progresses.
Course: 303
Course Release Date: 01/06/97
Update Release Date: 05/01/2001
Associated O/S Releases: VOS-14.3
Notice
Stratus Technologies, Inc., assumes no responsibility for the use or reliability of its software on equipment
that is not furnished by Stratus Technologies, Inc.
This document is protected by copyright. All rights are reserved. No part of this document may be
photocopied, reproduced, or translated to another language without the prior written consent of Stratus
Technologies, Inc.
Stratus, Continuous Processing, StrataNET, FTX, and the Stratus logo are registered trademarks of Stratus
Technologies International, S.à r.l.
Continuum, XA, XA/R, StrataLINK, RSN, SINAP, and the SQL/2000 logo are trademarks of Stratus
Technologies International, S.à r.l.
VOS Fundamentals
In the VOS Fundamentals Course, you learn the skills necessary to use and
manage your Stratus environment. It is designed for those who have no prior
VOS experience. You learn the basic user interface and become familiar
with the most commonly used commands. With a combination of lectures,
demonstrations and hands-on experience, you build the knowledge base that
every VOS user needs. The skills you acquire in this course are the first step
toward mastering the Stratus environment. You are introduced to the basic
functionality of the VOS Full-Screen Editor. You have an opportunity for
hands-on experiences creating, editing and moving through text files within
the Editor.
Major Topics
• Basic commands
• Directory structure
• Security for files and directories
• Editing files
• Abbreviations
• Non-interactive processes
• Command macros
Audience
• This course is the prerequisite for most VOS courses and should be
taken by anyone new to the VOS environment.
Prerequisites
Duration: 4 days
Stratus® VOS Fundamentals 303
Table of Contents
Table of Contents - 1
VOS Fundamentals 303 Stratus®
Table of Contents - 2
Stratus® VOS Fundamentals 303
Table of Contents - 3
VOS Fundamentals 303 Stratus®
Table of Contents - 4
Stratus® VOS Fundamentals 303
Table of Contents - 5
VOS Fundamentals 303 Stratus®
Table of Contents - 6
Stratus® VOS Fundamentals 303
Table of Contents - 7
VOS Fundamentals 303 Stratus®
Course Map
DAY 1
Chapter 1 - Overview of the Stratus System
Chapter 2 - Getting onto the System
Chapter 3 - The Directory Structure
Chapter 4 - File System Overview
DAY 2
Chapter 5 - Access Control
Chapter 6 - Introduction to Editing
Chapter 7 - Editing Text using edit
Chapter 8 - Edit Timesaving Techniques
DAY 3
Chapter 9 - Using the Abbreviations Facility
Chapter 10 - Process Attributes and Resources
Chapter 11 - Batch and Started Processes
Chapter 12 - Command Macros I
DAY 4
Chapter 13 - Command Macros II
Chapter 14 - Macro Input Parameters
The course map shows approximately how the topics will be covered in class.
The instructor may make changes to this map to make the class more effective
for you.
Table of Contents - 8
Stratus® VOS Fundamentals 303
Table of Contents - 9
Stratus® VOS Fundamentals 303
Slide 1-1
303 - VOS Fundamentals
Chapter 1
An
An Overview
Overview of
of the
the Stratus
Stratus System
System
Education
Stratus
Slide 1-2
Objectives
•• Define
Define the
the Stratus
Stratus terms
terms for
for components
components of
of aa
system.
system.
•• Identify
Identify the
the Stratus
Stratus peripherals
peripherals and
and software
software
facilities.
facilities.
Education
Stratus
Objectives
In order to become an effective Stratus user in the shortest time, the student needs
to find out a little bit about how they see the system, as well as how the system
sees them, the user. This Chapter will help the student understand the resources of
their Stratus system.
Slide 1-3
Stratus Continuous Availability
•• Fault
Fault tolerant
tolerant
•• Reliability
Reliability
Education
Stratus
Stratus Continuous Availability
• The system has the capability to perform its functions, even in the
presence of a hardware failure, i.e., the system is fault tolerant.
Slide 1-4
Tolerance
Stratus Stratus
board board
Education
Stratus
Stratus Hardware Fault Tolerance
• Self-checking Boards
All Stratus boards have a common layout to provide self-checking, i.e.
the board can determine if it is not functioning properly thereby insuring
data integrity.
• Duplexed Boards
Boards are duplexed (paired) to provide protection in case of a failure.
Slide 1-5
Traditional CPU Board
Processor
2+3=5
5
Output
Education
Stratus
Traditional CPU Board
In the traditional CPU, there is minimal checking of the output, but this doesn't
guarantee that the output is correct.
Slide 1-6
Stratus Self-Checking CPU Board
Input
2+3=?
Processor Processor
2+3=5 2+3=5
5 5= 5
Output
Education
Stratus
Stratus Self-Checking CPU Board
Each CPU board has two circuits doing the same calculation at the same time.
The results are compared to make sure they are the same. Thus, the boards are
self-checking.
Slide 1-7
Input Input
Processor 2 +3 =? Processor 2 + 3 = ?
5 =5 5 =5
5
Output
Education
Stratus
Stratus Duplexed Architecture
Duplexing of Stratus Self-Checking Boards means that there are two identical
boards performing the exact same function at exactly the same time (lock-step).
If one fails, the other keeps processing without degradation of performance.
Slide 1-8
(cont)
5=5 6 5
Stop
5
Output
Education
Stratus
Stratus Duplexed Architecture
Slide 1-9
StrataBUS
Backpanel
A Bus B Bus C
Connectors
30
31
CPU
CPU
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Education
Stratus
I/O Adapter Chassis I/O Adapters
• Memory Boards
• StrataLINK Boards
Continuum Duplexed
Slide 1-10
Architecture
• SCSI-ENET Boards
• PKIO Boards
• ReCC Boards
Slide 1-11
A Stratus System
Education
Stratus
processing modules up to severalmiles apart
A Stratus System
• The user of a Stratus System sees the resources of all modules as being
part of one system. Any user can access all disks, printers, etc.
• The system can be dispersed to where the work is. It does not have to be
concentrated in a computer room.
Slide 1-12
Networking Stratus Systems
X25
Public
Network
Education
Stratus
Tokyo
Slide 1-13
Stratus System Software
Education
Stratus
Stratus System Software
The Stratus supports four operating systems: VOS (Virtual Operating System), a
fault tolerant UNIX operating system (FTX, Hewlett-Packard UNIX (HP-UX) and
Microsoft Windows 2000. They are the user's interface into a Stratus system.
• The slide shows the login banner for the VOS Operating System.
It shows:
Slide 1-14
Other Stratus Software
•• Programming
Programming Languages
Languages
Education
Stratus
Other Stratus Software
• Programming languages
- Basic
-C
- C++ (Rel 14.3)
- COBOL
- PL/1
- FORTRAN77
- Pascal
Slide 2-1
303 - VOS Fundamentals
Chapter 2
Getting
Getting Onto
Onto the
the System
System as
as aa User
User
Education
Stratus
Slide 2-2
Objectives
Education
Stratus
Objectives
The first thing the student needs to be able to do is to log into the system and
execute some of the basic commands. In this chapter, the student learns to log in
and out of the system, execute commands, and customize the terminal
environment.
Slide 2-3
Window to the System
- Stratus keyboards have function keys (V102 has 22, V103 has 20).
These function keys provide default functions that are recognized
by VOS and VOS applications.
Slide 2-4
Logging onto the System
•• Logging
Logging in
in
•• The
The ready
ready prompt
prompt
•• Logging
Logging out
out
Education
Stratus
Logging onto the System
• Logging in:
• Logging out:
Slide 2-5
Types of Commands
•• Privileged
Privileged commands
commands
•• Command
Command Line
Line
help
help -match
-match file;
file; help
help -match
-match print
print
Education
Stratus
Types of Commands
• Privileged commands
- Some commands.
• Command Line
Separated by semicolon(s)
Executed sequentially
Slide 2-6
Command Arguments
•• VOS
VOS commands
commands take
take three
three kinds
kinds of
of arguments
–– Switch:
Switch: on
on print
print old
old -line_numbers
-line_numbers
off
off copy_file
copy_file old
old new
new -no_keep_extents
-no_keep_extents
–– Option:
Option: print
print old
old -copies
-copies 55
help
help -match file
-match file
Education
Stratus
• VOS commands can take three kinds of arguments
- Positional
- Switch
- Option
on
off
Note: Changes to the default settings of any argument are only effective
for the current execution of the command.
Slide 2-7
Display Command Arguments
Usage:
Usage: copy_file
copy_file source_file
source_file [destination]
[destination] [-pack]
[-pack]
[-parallel]
[-parallel] [-truncate] [-delete] [-keep_dates]
[-truncate] [-delete] [-keep_dates]
[-keep_acl]
[-keep_acl] [-no_keep_extents]
[-no_keep_extents] [-brief]
[-brief]
[-keep_safety_switch]
[-keep_safety_switch]
ready:
ready:
Education
Stratus
Displaying command arguments
To determine the correct keywords (arguments) and the required order for
positional arguments on any command, use the -usage or the -form option.
The -usage option displays the command's arguments on the terminal and then
returns to the ready: prompt.
Arguments that are enclosed in square brackets ([ ]) are optional. They usually
have default values.
Arguments that are not enclosed in square brackets require the user to enter a
value.
Slide 2-8
Display Command Arguments
------------------------------
------------------------------ copy_file
copy_file ---------------------------
---------------------------
source_file:
source_file:
destination:
destination:
-pack:
-pack: no
no
-parallel:
-parallel: no
no
-truncate:
-truncate: no
no
-delete:
-delete: no
no
-keep_dates:
-keep_dates: no
no
-keep_acl:
-keep_acl: no
no
-keep_extents:
-keep_extents: yes
yes
-brief:
-brief: no
no
-keep_safety_switch:
-keep_safety_switch: no
no
Education
Stratus
Displaying command arguments
The [DISPLAY FORM] key or the -form option will display the arguments of the
command on the terminal vertically and will not return the user to the ready:
prompt. The values initially displayed in the argument fields are the default values.
If the value field is displayed in reverse video (high lighted), the user is required to
enter a value there in order for the command to be executed.
While in the form of the command, the cursor may be moved to any argument and
the user may overwrite the default. (more later)
Slide 2-9
Editing the Command Line
–– Insert
Insert Mode
Mode
–– Positioning
Positioning cursor
cursor
–– Deleting
Deleting characters
characters
–– Canceling
Canceling the
the command
command
Education
Stratus
Editing the Command Line
• Many of the function keys are available for editing the command line.
- Insert mode
- Positioning cursor
[Right Arrow] [Left Arrow]
[SHIFT]-[Right Arrow] [SHIFT]-[Left Arrow]
[GOTO] -[Right Arrow] [GOTO] -[Left Arrow]
- Deleting characters
[BACKSPACE] [DELETE]-[WORD]
[DEL] [DELETE]-[Right Arrow]
[DELETE]-[Left Arrow]
Slide 2-10
Editing the Command Line
–– Positioning
Positioning in
in the
the form
form
–– Cycle
Cycle fields
fields
–– Executing
Executing the
the form
form
–– Canceling
Canceling the
the form
form
Education
Stratus
Editing the Command Line (continued)
- Cycle fields
[CYCLE] [CYCLE-BACK]
[Right Arrow] [Left Arrow]
Slide 2-11
Canceling Execution
–– Canceling
Canceling the
the output
output of
of aa command
command
–– Stopping
Stopping execution
execution of
of aa command
command
–– Saving/restoring
Saving/restoring command
command lines
lines
Education
Stratus
Canceling the execution of a command
Slide 2-12
Command Functions
display_line
display_line Time
Time is
is (time)
(time)
Education
Stratus
Command Functions
• Command Functions may also have arguments. Use the VOS StrataDOC
facility to list the arguments and obtain the proper syntax.
Slide 2-13
Online Help Facility
Education
Stratus
Online Help Facility
The Stratus online help facility is part of the operating system that provides users
with a list of commands and command functions at the terminal screen.
topic_name: No longer supported.
Slide 2-16
Environment
---------------------------
---------------------------set_terminal_parameters
set_terminal_parameters--------------------------
--------------------------
Education
Stratus
Customizing the Terminal Environment
set_terminal_parameters
display_terminal_parameters
Slide 2-15
Some Basic Commands
Files:
Files: 4,
4, Blocks:
Blocks: 16
16
ww 22 abbreviations
abbreviations
ww 77 auto.pm
auto.pm
ww 66 count_25.pm
count_25.pm
ww 11 demo_file
demo_file
Education
Stratus
The list command
• The list command is used to see the names of the files and
subdirectories in a directory.
• By default, the list command shows only the files in the directory.
Slide 2-18
Some Basic Commands
–– Used
Used to
to see
see the
the contents
contents of
of aa particular
particular file
file
display
display abbreviations
abbreviations
Education
Stratus
The display command
Slide 2-19
Some Basic Commands
------------------------------------print
------------------------------------ print-----------------------------------
-----------------------------------
Education
Stratus
The print command
• The print command puts a print request into a print queue for printing.
Slide 2-20
Some Basic Commands
•• Managing
Managing print
print requests
requests
–– The list_print_requests command
The list_print_requests command
Education
Stratus
-ask:
-ask: yes
yes
Slide 2-21
Some Basic Commands
Education
Stratus
Sending a message
Slide 2-22
Logging the Terminal Session
•• Use
Use the start_logging command
the start_logging command to
to log
log the
the
•• Use
Use the stop_logging command
the stop_logging command to to stop
stop any
any
more
more terminal
terminal output
output from
from going
going in
in the
the file.
file.
ready:
ready: stop_logging
stop_logging
Education
Stratus
Logging the Terminal Session
• Use the start_logging command to capture the I/O traffic for the
terminal session into a file.
• Use the stop_logging command to stop any more terminal output from
going in the file.
ready: stop_logging
- You can display and print log files once logging has stopped.
word [SHIFT]-[RightArrow]
[SHIFT]-[LeftArrow]
Remember
Use the -usage or -form keyword or [DISPLAY FORM] key to help you
complete these exercises.
7. A line in the abbreviations file contains the word, logout. Using the
display command with –match, find the word logout in this file.
Optional
11. Print your log file with page numbers at the bottom of each page.
Have the system notify you when the job is finished.
(You'll need to read Appendix C - to see how to get page numbers
at the bottom of each printed page.)
13. Logout.
14. Observe the results when you attempt to login as a privileged user.
You should receive an error message.
Slide 3-1
303 - VOS Fundamentals
Chapter 3
The
The Directory
Directory Structure
Structure
Education
Stratus
Slide 3-2
Objectives
•• Describe
Describe thethe hierarchical
hierarchical directory
directory structure
structure
Education
Stratus
Objectives
Hierarchical Directory
Slide 3-3
Structure
Education
Stratus
Hierarchical Directory Structure
• The objects in the directory structure are directories, files, and links.
Slide 3-4
Level Structure
#d101
p e rs o n d ire c to rie s
p e rs o n d ire c to rie s
we e kly mo nthly
Education
Stratus
we e k-02-18 we e k-02-25
• The first level subdirectories under the master disk are the system
directories and group directories for users.
• Group directories are generally one level below the disk directory.
• Typically, the person directories are one level below their group
directory.
Slide 3-5
Full Path Names
Education
Stratus
Full Path Names
• You can construct a path name which uniquely identifies an object in the
directory structure.
• A full path name can be used from anywhere in the network to uniquely
reference any object.
Slide 3-6
Sample Directory
#d101
p e rs o n d ire c to rie s
w e e kly mo n th ly
Education
Stratus
w e e k-0 2 -1 8 w e e k-0 2 -2 5
Sample Directory
Slide 3-7
Relative Path Names
•• ## refers
refers to
to aa specific
specific disk
disk directory
directory
Education
Stratus
Relative Path Names
Relative means dependent on your current location within the directory hierarchy.
• A relative path name beginning with the > refers to the current disk
directory.
• A relative path name starting with the < refers to one level above the
current directory.
• A path name starting with a character other than %, #, >, or < refers to
an object within your current directory.
display_line (current_dir)
- You can also use the command display_current_dir to see the path
name of your current directory.
ready: display_current_dir
%class#d101>VOS_Fundamentals>vf2
ccd >VOS_Fundamentals>vf3
ccd <VOS_Fundamentals>vf1
ccd >
Slide 3-8
list command
Education
Stratus
Looking at the Contents of a Directory
• The list command can be used with a path name to show files in a
directory other than the current directory.
Note: You must put >* at the end of the path name.
list >VOS_Fundamentals>vf2>*
Slide 3-9
Directory Commands
--------------------
-------------------- create_dir
create_dir --------------------
--------------------
directory_name: reports>yearly
directory_name: reports>yearly
Education
Stratus
• create_dir: Used to create a new subdirectory
Naming an Object
• Allowable characters
- Upper and lower case characters are unique. (e.g., test is a different
filename than TEST).
- Digits 0-9
- ASCII characters
@ [ \ ] ^ ` { | } ~ " $ + , - . / : _
Slide 3-10
Directory Commands
--------------------
-------------------- delete_dir
delete_dir --------------------
--------------------
directory_name:
directory_name: weeklyweekly
-ask:
-ask: yes
yes
-expired_only:
-expired_only: yes yes
-brief:
-brief: no
no
Education
Stratus
• delete_dir: Deletes a directory and everything contained in it,
and everything below it.
-ask: If the directory is not empty, the command will ask if you wish to
delete the directory.
-expired_only: Delete only those files whose expiration dates have passed.
-brief: Suppress the display of each directory name that matches a star name.
Slide 3-11
Directory Commands
ready:
ready:copy_dir
copy_dir reports
reports >VOS_Fundamentals>public_reports
>VOS_Fundamentals>public_reports -form
-form
Education
Stratus
• copy_dir: Copies a directory and its contents to another place.
Slide 3-12
Directory Commands
--------------------
--------------------move_dir
move_dir-------------------------------
-------------------------------
source_directory:
source_directory: reports
reports
destination:
destination: >VOS_Fundamentals>public_reports
>VOS_Fundamentals>public_reports
-pack:
-pack: no
no
-delete:
-delete: no
no
-keep_dates:
-keep_dates: no
no
-brief:
-brief: no
no
Education
Stratus
• move_dir: Creates a copy of a directory and its contents,
and then deletes the original directory.
Slide 3-13
Directory Commands
--------------------
--------------------rename
rename-------------
-------------
old_name:
old_name: memos
memos
new_name:
new_name: per_memos
per_memos
-delete:
-delete: nono
-files:
-files: yes yes
-dirs:
-dirs: no
no
-links:
-links: no no
-brief:
-brief: no no
Education
Stratus
• rename: Changes the name of the directory.
Slide 3-14
Directory Commands
ready:
ready:display_dir_status
display_dir_status per_memos
per_memos -form
--------------------------
--------------------------display_dir_status
display_dir_status-------------------
-------------------
directory_names:
directory_names: per_memos
per_memos
name:
name: %educ#d102>Education>Jack_Rabbit>per_memos
%educ#d102>Education>Jack_Rabbit>per_memos
last used at:
last used at: 01-07-14
01-07-1414:08:42
14:08:42est
est
last modified at: 01-07-14 14:08:42
last modified at: 01-07-14 14:08:42 est est
last
lastsaved
savedat:
at: never
never
time
timecreated:
created: 01-07-14
01-07-1414:08:14
14:08:14est
est
blocks used:
blocks used: 11
mode:
mode: mm
author:
author: Jack_Rabbit.Education
Jack_Rabbit.Education
Education
Stratus
• display_dir_status: Displays information about a specified
directory
Slide 3-15
Links in the Directory Structure
#d101 #d102
we ekly mo nthly
vf1 vf2 vf3 vp1 vp2
we ek-02-18
s tart up.cm
Education
Stratus
Links in the Directory Structure
• You can reference the name of a link the same way you would use the
path name of an object.
ccd rpt
ccd rpt
weekly ->%class#d101>reports>weekly
display weekly>week-02-18
Note: Links can point to other links. However, if there are more than
10 links in the chain, VOS stops the search and displays an error
message.
Slide 3-16
Link Commands
--------------------
--------------------link
link--------------------
--------------------
--------------------
--------------------unlink
unlink--------------------
--------------------
link_names:
link_names: vu
vu
-ask:
-ask: yes
yes
-brief:
-brief: no
no
Education
Stratus
Link Commands
• Use list -links or list -all to see the links in your current
directory.
• Use the where_path command to chase links and return the name of the
object at the final destination. Very helpful when links point to links.
-link: displays all links encountered while resolving the path name.
Slide 3-17
walk_dir command
walk_dir -------------------
Education
Stratus
walk_dir command
• The walk_dir command walks through the directory tree, executing the
same command in the directory specified and all its subdirectories.
• If the command line uses external commands, set the appropriate start
process argument to yes. This is not required for internal commands.
change_current_dir (9)
copy_dir (14)
create_dir (11)
delete_dir (13)
display_current_dir (9)
display_dir_status (17)
link (20)
list (10)
move_dir (15)
rename (16)
unlink (20)
walk_dir (21)
where_command (21)
where_path (20)
(current_dir) (9)
Purpose: To practice using and moving around the directory structure and
also to use a to link to reference a file in another directory.
3. List all the files, directories, and links in your current directory.
4. Go to your group level directory. Show the name of your current directory.
8. Remain in test_dir and display the contents of your abbreviations file using
the link you just created.
Optional
12. From your home directory, test the arguments that can be used with the list
command.
vf1
test_dir abbreviations
ab
Slide 4-1
303 - VOS Fundamentals
Chapter 4
The
The File
File System
System Overview
Overview
Education
Stratus
Slide 4-2
Objectives
Education
Stratus
Objectives
This Chapter teaches you how to use the file system effectively.
Slide 4-3
File System
Sales
John_Smith
test.cm
Education
Stratus
File System
• The maximum file size varies depending on the file organization and
whether the file was created with extents.
• Provided you have the disk space, a VOS file that does not use extents
can grow to an approximate maximum of 2.15 GB.
• A suffix is a character string that begins with a period as part of the name
of an object in the I/O system.
sales.memo
_edit.t14.6
report.feb.19 (multiple suffixes)
sales.backup
start_up.cm
budget.pm
budget.cobol
Slide 4-4
Star Names
list
lista*
matches
matches on
on star
starrepresents
represents
abbreviations
abbreviations **== bbreviations
bbreviations
a.cm
a.cm **== .cm
.cm
aa **== null
nullstring
string
Education
Stratus
Star Names
- Perform the operation on every object which matches the star name
The directory containing the files, maintains the attributes of files, including:
• path name
• file organization
sequential
fixed
relative
stream
server queue
message queue
one way server queue
• protection
transaction file
log protected
safety switch
expiration date
• file size
extent size
next byte or record size:
num indexes
blocks used
allocation size
• access mode
• author
Slide 4-5
display_file_status command
ready: display_file_status personnel_file -form
------------------- display_file_status -------
file_names: personnel_file
Education
Stratus
display_file_status command
Slide 4-6
create_file
ready:
ready:create_file
create_file new_file
new_file -form
--------------------
--------------------create_file
create_file--------------------
--------------------
file_name:
file_name: new_file
new_file
-organization:
-organization: sequential
sequential
-record_size:
-record_size:
-num_records:
-num_records:
-extent_size:
-extent_size: 11
-dynamic_extents:
-dynamic_extents: no no
-character_set:
-character_set: none
none
-shift_mode:
-shift_mode: all
all
Education
Stratus
• create_file: Creates an empty file of a specified organization.
file_name: Name of the new file
-organization: (sequential, fixed, relative, stream, etc)
-record_size: Max number of bytes in a record
Slide 4-7
File Protect Commands
·· ready:
ready:set_expiration_date
set_expiration_date abbreviations
abbreviations 01-12-31
01-12-31 -form
-form
·· ready:
ready:set_safety_switch
set_safety_switch personnel_list
personnel_list -form
-form
--------------------
--------------------set_safety_switch
set_safety_switch--------------------
--------------------
file_name: personnel_list
file_name: personnel_list
state:
state: on
on
Education
Stratus
• set_expiration_date:
• set_safety_switch:
Slide 4-8
File Protect Commands
·· ready:
ready:set_transaction_file
set_transaction_file datalog
datalog -form
-form
·· ready:
ready:set_log_protected_file
set_log_protected_file protectalog
protectalog -form
-form
--------------------set_log_protected_file
--------------------set_log_protected_file----------------
----------------
file_name: protectalog
file_name: protectalog
state:
state: on
on
Education
Stratus
• set_transaction_file:
• set_log_protected_file:
Records are written to the log partition before they are written to
the data file.
Slide 4-9
File Manipulation Cmds
ready:
ready:copy_file
copy_file personnel_file
personnel_file 2001_personnel
2001_personnel -form
--------------------
--------------------copy_file
copy_file-----------------------------
-----------------------------
source_file:
source_file: personnel_file
personnel_file
destination:
destination: 2001_personnel
2001_personnel
-pack:
-pack: no
no
-truncate:
-truncate: no
no
-delete:
-delete: no
no
-keep_dates:
-keep_dates: no
no
-keep_acl:
-keep_acl: no
no
-keep_extents:
-keep_extents: yes
yes
-brief:
-brief: no
no
-keep_safety_switch:
-keep_safety_switch: no
no
Education
Stratus
• copy_file: Copies the contents of a file or set of files to another file or
set of files.
.
-pack: Discard deleted records to save space.
-parallel: Used when –pack is yes. Simultaneously
rebuilds all indexes as file is copied.
-truncate: Truncate the existing destination file
before copying a file to it.
Slide 4-10
File Manipulation Cmds
ready:
ready:move_file
move_file personnel_file
personnel_file >reports>rpt
>reports>rpt -form
--------------------
--------------------move_file
move_file--------------------
--------------------
source_file:
source_file: personnel_file
personnel_file
destination:
destination: >reports>rpt
>reports>rpt
-pack:
-pack: no
no
-truncate:
-truncate: no
no
-delete:
-delete: no
no
-keep_dates:
-keep_dates: no
no
-keep_acl:
-keep_acl: no
no
-brief:
-brief: no
no
Education
Stratus
• move_file: Moves a file, or set of files, to another file or directory.
destination: If blank, defaults to the current directory.
-pack: Discard deleted records.
-truncate: Truncate an existing destination file before
moving an input file to it.
-delete: Delete destination file if one exists.
Slide 4-11
File Manipulation Cmds
ready:
ready:delete_file
delete_file new_file
new_file -form
--------------------
--------------------delete_file
delete_file--------------------
--------------------
file_names:
file_names: new_file
new_file
-ask:
-ask: yes
yes
-brief:
-brief: no
no
-force:
-force: no
no
Education
Stratus
• delete_file: Deletes one or more files from a directory.
-ask: If a star name is used, the command asks
whether to delete a file with a matching name.
-brief: Display file names if star name is used.
-force: Mark for deletion a file that is in use.
The command deletes the file after all users
have closed it.
Slide 4-12
File Manipulation Cmds
--------------------
--------------------truncate_file
truncate_file--------------------
--------------------
--------------------rename
rename-------------------------
-------------------------
old_name:
old_name: 2001_personnel
2001_personnel
new_name:
new_name: personnel_list
personnel_list
-delete:
-delete: no
no
-files:
-files: yes
yes
-dirs:
-dirs: no
no
-links:
-links: no
no
Education
Stratus
-brief:
-brief: no
no
• truncate_file: Clears the data area of a file, but maintains the file
attributes.
-retain: Retains the allocated disk space
Slide 4-13
Listing and Displaying
list
list -full
Files:
Files:6,
6,Blocks:
Blocks:20
20
ww 11seq
seq 00-12-20
00-12-2009:46:00
09:46:00 _edit.os_telnet1.4.1
_edit.os_telnet1.4.1
ww 22seq
seq 99-04-15 16:22:59 abbreviations
99-04-15 16:22:59 abbreviations
ww 14 seq
14 seq 01-02-01
01-02-0111:17:26
11:17:26 as_meter_file
as_meter_file
ww 11stm
stm 99-04-19 13:57:13 recc_boot.out
99-04-19 13:57:13 recc_boot.out
ww 11stm
stm 99-04-19
99-04-1913:58:41
13:58:41 recc_config.out
recc_config.out
ww 11seq
seq 99-04-15
99-04-1516:22:59
16:22:59 start_up.cm
start_up.cm
Education
Stratus
• The list command will show the files in a directory.
Slide 4-14
Listing and Displaying
---------------------------------
---------------------------------display
display--------------------------------
Education
Stratus
-file_separator:
-file_separator: none
none
• Useful arguments:
-match: [character_string]
Displays only the lines in the files that
contain the character string.
-first_line: [line_number]
Starts the display at the specified line.
-last_line: [line_number]
Ends the display at the specified line.
-line_numbers: Includes line numbers in the output.
-min_lines: [number_of_lines]
Number of lines to be displayed following each
line containing the character specified in
–match.
Slide 4-15
Listing and Displaying
Education
Stratus
• The tail_file command enables you to display the last part of an
ASCII file. By default, the command displays the last 10 lines.
Slide 4-16
Listing and Displaying
%dal#d108>VOS_Fundamentals>samples>2_on_system
%dal#d108>VOS_Fundamentals>samples>2_on_system
personnel_file
personnel_file
%dal#d108>VOS_Fundamentals>samples>6_files
%dal#d108>VOS_Fundamentals>samples>6_files
personnel_file
personnel_file
%dal#>VOS_Fundamentals>samples>8_batch
%dal#>VOS_Fundamentals>samples>8_batch
personnel_file
personnel_file
Education
Stratus
• The locate_files command will walk through the directory structure
looking for files which match on the specified name.
-------------------- locate_files ------------------------
file_names: Name or star name of files you want to locate.
-root_dir: The top directory to start the search.
The default is the current directory.
• The command lists the full path name of a directory that contains one
or more files with matching names.
Slide 4-17
Listing and Displaying
AA(%ed31#d102>Education>Bruce_Sadler>start_up.cm)
(%ed31#d102>Education>Bruce_Sadler>start_up.cm)does
doesnot
notmatch
match
BB(%ed31#d102>Education>Bruce_Sadler>start_up.cm.backup).
(%ed31#d102>Education>Bruce_Sadler>start_up.cm.backup).
B38
B38 display_line
display_line
inserted
insertedbefore
before
A39
A39 display_line
display_line' ' Welcome
Welcome'(person_name)
'(person_name)
11data
datadifference(s).
difference(s).
Education
Stratus
• The compare_files command will display the differences of two files.
Slide 4-18
sort command
------------------------------- sort ---------------------------------
sort_path_names: personnel_file
Education
Stratus
sort command
sort personnel_file
• You can specify the positions, the lengths, and the collating sequence of
up to four keys or fields to be used by the sort command, in the
command itself, or up to 32 keys in a sort control file.
• By default, the output of the sort command overwrites the input file.
• Any record shorter than the length key will be written to the exceptions
file.
Slide 4-19
Sort Control File
The
Thefollowing
followingisisan
anexample
exampleofofaasort
sortcontrol
controlfile.
file.
Education
Stratus
end;
end;
compare_files (19)
copy_file (11)
create_file (8)
delete_file (13)
display (16)
display_file_status (7)
list (15)
locate_files (18)
move_file (12)
rename (14)
set_expiration_date (9)
set_log_protected_file (10)
set_safety_switch (9)
set_transaction_file (10)
sort (20)
tail_file (17)
truncate_file (14)
Purpose: To use the appropriate file command to copy, view attributes, sort,
locate, and protect various files.
3. Display the status of the file, media. Note the date and time created, the
author, the size.
4. Create a directory called music. Copy the file, media, into the new
directory.
5. Use the locate_files command to search for all files, starting with your home
directory that contain media in their name. You should find 3 files.
First, sort the full record and produce an output file with the name,
media.sort.
Next, alphabetically sort using the field that begins in column 11.
Optional
8. Set an expiration time on your media file to be later than the current time.
Observe what happens when you attempt to delete the file.
Remove the expiration date.
Slide 5-1
303 - VOS Fundamentals
Chapter 5
Access
Access Control
Control
Education
Stratus
Slide 5-2
Objectives
•• Use
Use the
the access
access control
control commands
commands to
to control
control
access
access to
to user
user files
files
Education
Stratus
Objectives
Slide 5-3
Access Control
Sales (ACL)
John_Smith (ACL)
test.cm (ACL)
Education
Stratus
Access Control Mechanism
• An Access Control List allows you to define who can use your files and
directories. You also get to decide the extent of this access.
(For example, can someone change the contents of your files or can
she/he just execute them?)
Slide 5-4
Access Control Entry
m John_Smith.Sales
s *.Sales
n *.*
Education
Stratus
Access Control Entry
Slide 5-5
User Name
Education
Stratus
When you log into a Stratus, the operating system assigns a user name to your
process. You can see your user name with the command function (user_name).
For example:
John_Smith.Sales
- A Person Name
- A Group Name
Slide 5-6
Order of ACL Entries
•• Entries
Entries in
in an
an ACL
ACL are
are ordered
ordered in
in aa list
list from
Education
Stratus
Access Control Lists (continued)
• The way Access Control Lists represent user names can take four forms:
• The operating system searches an Access Control List from the top down
and uses the access right associated with the first match.
Slide 5-8
Directory Access Control
DIR_B DIR_C
Education
Stratus
Directory Access Control
• The Access Control List (ACL) that protects a directory is stored in the
directory's parent directory.
• When you create a new directory, the initial contents of its Access
Control List are the same as its parent directory.
• The copy_dir command brings the ACL of the source directory to the
destination directory.
Slide 5-8
Directory Access Types
Education
Stratus
Directory Access Types
- Status
- Null
- Unspecified
Slide 5-9
Directory ACL Commands
ready:
ready: display_access_list
display_access_list -form
-form
-----------------
----------------- display_access_list
display_access_list -------------
ready:
ready: give_access
give_access status
status my_dir
my_dir -user
-user vf2.*
vf2.* -form
-form
------------------- give_access --------------------
------------------- give_access --------------------
access:
access: status
status
path_names:
path_names: my_dir
my_dir
-user:
-user: vf2.*
vf2.*
ready:
ready: remove_access
remove_access my_dir
my_dir -user
-user vf2.*
vf2.* -form
-form
--------------------
-------------------- remove_access
remove_access -----------------
-----------------
path_names:
path_names: my_dir
my_dir
Education
Stratus
-user:
-user: vf2.*
vf2.*
-all:
-all: no
no
Note: To specify the current directory, enter a period (.) for the path.
Go to next page.
5 - 10 Access Control
Stratus® VOS Fundamentals 303
Slide 5-11
File Access Control
Education
Stratus
File Access Control
• The Access Control List that protects a file is stored in its parent
directory.
• When you create a file, its specific Access Control List (ACL) is empty.
Use the give_access command to add entries.
• If there is an Access Control List (ACL) for a file, it does not get carried
to the new file by copy_file.
Access Control 5 - 11
VOS Fundamentals 303 Stratus®
Slide 5-11
File Access Types
FILE ACCESS TYPES
n
(null) Null access denies users all access to the file.
Education
u
Stratus
(unspecified) Equivalent to null access.
• Access types for files are different from access types for directories.
- Execute
- Null
- Unspecified
5 - 12 Access Control
Stratus® VOS Fundamentals 303
Slide 5-12
File ACL Commands
ready:
ready: display_access_list
display_access_list -form
-form
-----------------
----------------- display_access_list
display_access_list -------------
ready:
ready: give_access
give_access write
write demo_file
demo_file -user
-user vf2.*
vf2.* -form
-form
------------------- give_access --------------------
------------------- give_access --------------------
access:
access: write
write
path_names:
path_names: demo_file
demo_file
-user:
-user: vf2.*
vf2.*
ready:
ready: remove_access
remove_access demo_file
demo_file -user
-user vf2.*
vf2.* -form
-form
--------------------
-------------------- remove_access
remove_access -----------------
-----------------
path_names:
path_names: my_dir
my_dir
Education
Stratus
-user:
-user: vf2.*
vf2.*
-all:
-all: no
no
Access Control 5 - 13
VOS Fundamentals 303 Stratus®
Slide 5-13
Default Access Control
Education
Stratus
Default Access Control List
• Default Access Control List (DACL) goes with a directory, but controls
all the files in the directory (not the directory itself).
• The access types in a Default Access Control List (DACL) are file
types: write, read, execute, null.
5 - 14 Access Control
Stratus® VOS Fundamentals 303
Default Access Control List
• The Default Access Control List (DACL) is carried from parent to new
subordinate directory by create_dir.
• The Default Access Control List (DACL) is copied from the source
directory to the new directory by copy_dir.
Access Control 5 - 15
VOS Fundamentals 303 Stratus®
Slide 5-14
Default Access Commands
ready:
ready: display_default_access_list
display_default_access_list -form
-form
------------------
------------------ display_default_access_list --------
display_default_access_list
ready:
ready: give_default_access
give_default_access -form
-form
-----------------
----------------- give_default_access
give_default_access ---------
---------
access:
access: read
read
directory_names:
directory_names: my_dir
my_dir
-user:
-user: *.VOS_Fundamentals
*.VOS_Fundamentals
ready:
ready: remove_default_access
remove_default_access -form
-form
---------------
--------------- remove_default_access ---------------
remove_default_access ---------------
directory_names:
directory_names: my_dir
my_dir
Education
Stratus
-user:
-user: vf2.VOS_Fundamentals
vf2.VOS_Fundamentals
-all:
-all: no
no
5 - 16 Access Control
Stratus® VOS Fundamentals 303
Slide 5-15
Lists
•• The
The list -all displays
list -all displays each
each file
file and
and directory
directory in
in the
the
current
current directory
directory and
and your
your access
access to
to each
each of
of them.
them.
Files:
Files: 1,
1, Blocks:
Blocks: 00
ww 00 demo_file
demo_file
Directories:
Directories: 22
mm 11 my_dir
my_dir
mm 11 test_dir
test_dir
Education
Stratus
Checking Permissions on Access Lists
• The quickest method to find your access to files and directories is to use
the list -all command.
Access Control 5 - 17
VOS Fundamentals 303 Stratus®
Slide 5-10
Lists (cont)
•• The
The command display_access will
command display_access will
–– Display
Display the
the ACL
ACL and
and DACL
DACL of
of aa file
file
–– Report
Report the
the access
access of
of aa specific
specific user
user to
to aa file
file
–– Report
Report the
the access
access of
of aa specific
specific user
user to
to aa directory
directory
5 - 18 Access Control
Stratus® VOS Fundamentals 303
Checking Permissions on Access Lists
Access Control 5 - 19
VOS Fundamentals 303 Stratus®
Summary of Commands
display_access, da (18)
display_access_list, dal (9,13)
display_default_access_list, ddal (16)
give_access, ga (9,13)
give_default_access, gda (16)
remove_access, ra (9,13)
remove_default_access, rda (16)
5 - 20 Access Control
Stratus® VOS Fundamentals 303
Lab: Access Control
Purpose: To practice using various access control command to verify access rights
and to change them where possible and as directed.
2. Display the ACL to your home directory. What are the 2 commands to do
this?
_________________________________________________________
3. Display the Default Access Control List for your home directory.
5. Display the ACL to your abbreviations file for all users? How is this
different from the previous questions?
6. Give read access to the abbreviations file for Mary_Smith.Sales. Verify the
access.
7. Create a subdirectory called test_dir under your home directory. Display the
access list and default access list for test_dir. What happened?
_____________________________________________________________
Access Control 5 - 21
VOS Fundamentals 303 Stratus®
Lab: Access Control (continued)
10. Give default execute access for all files in test_dir to any person in the
Operations group.
11. Make an ACL entry to the abbreviations file in test_dir. The code is read
and the person named is John_Dunn in any group.
13. Verify the ACL & DACL for test_dir2 and the ACL for abbreviations
inside test_dir2. What happened?
5 - 22 Access Control
Stratus® VOS Fundamentals 303
Lab: Access Control (continued)
Optional
14. Set access on the directory, test_dir, so that you have status access.
What happens when you attempt to write the file (menu w)?
Return to the command line (menu q). Now edit the abbreviations file
using the argument -no_backup. Can you write the file out?
What is the difference?
15. Move back to your home directory. Give yourself modify access to the
directory, test_dir.
16. Give yourself default read access to the files in test_dir. Check your
access rights. Display the abbreviations file in test_dir.
Access Control 5 - 23
VOS Fundamentals 303 Stratus®
Lab: Access Control (continued)
What happened?
Move to another_dir.
5 - 24 Access Control
Stratus® VOS Fundamentals 303
vf1
test_dir
abbreviations
another_dir
abbreviations
Access Control 5 - 25
Stratus® VOS Fundamentals 303
Slide 6-1
303 - VOS Fundamentals
Chapter 6
Introduction
Introduction to
to Editing
Editing using
using edit
edit
Education
Stratus
Slide 6-2
Objectives
•• Describe
Describe thethe terminal
terminal keyboard
keyboard keys.
keys.
Education
Stratus
Introduction to Editing using edit
The edit command is a VOS command that calls the Full Screen Editor and
enables you to begin editing a file.
Slide 6-3
Terminal Keyboard
•• Overview
Overview of
of Key
Key Types
Types
Education
Stratus
The Terminal Keyboard
- The Full Screen Editor allows you to enter and modify text while
viewing the total screen area.
- When you execute the edit command, VOS positions the cursor
in a temporary area known as the default buffer.
- The default buffer is empty when you do not specify a file name on
the command line.
Slide 6-4
Default Edit Buffer
Working
Lines 1-20
System
%class#d101>VOS_Fundamentals>vf1>abbreviations
Area
Status
Line
Education
Stratus
Default Edit Buffer
• The default buffer contains the contents of a file when you follow the
edit command with the name of a specific file on the command line.
• Line 22 will show the buffer name preceding a colon followed by the full
pathname for a file if a file was loaded into the buffer.
Note: The default buffer name will not show on the screen.
Slide 6-5
Menu Requests
• There are some special keys that will require you to hold a key down
while pressing another key. This will be represented by showing a
hyphen between the two keys.
Slide 6-6
Terminating editor Requests
•• After
After execution
execution
–– Use
Use [CTRL
[CTRL -- BREAK]
BREAK]
Education
Stratus
Terminating Editor Requests
• Before execution
• After execution
Slide 6-7
HELP MENU
Press the [HELP] function key to display the [HELP] Menu. The Editor's Help
Menu provides definitions for the keys used in executing editor requests.
• Press the desired key(s) to get detailed information about the request.
Slide 6-8
Text Input
•• An
An invisible,
invisible, line-separating
line-separating character
character defines
defines
each
each line
line of
of text
text in
in the
the edit
edit buffer.
buffer.
Education
Stratus
Text Input
A Line of Text
- Press the [RETURN] key when you want to end a line of text or to
create a new line.
- There are two ways to remove the line separating character and
collapse two lines into one. If the cursor is at the end of the line,
press [DEL]. If the cursor is at the beginning of the following line,
press [BACKSPACE].
Slide 6-9
Simple Modifications to Text
•• Insert
Insert text
text at
at the
the cursor
cursor position.
position.
•• Position
Position the
the cursor
cursor on
on aa line
line by
by pressing
pressing the
the arrow
arrow
keys.
keys. ARROW KEYS
Education
Stratus
Simple Modifications to Text
Saving a File
You issue the write request to save the contents of your text buffer.
• The Editor writes the contents of the text buffer to permanent storage in a
file when you follow these steps:
1. Write request
[MENU] [W]
3. The editor displays the complete path name if one didn't exist.
%class#d01>VOS_Fundamentals>vf1>letter
• If there is a path name already associated with the edit session, you
don't have to re-enter the name when you write it (save it to disk). The
path name becomes the default name, making it unnecessary to re-enter
the name.
1. Write request
[MENU] [W]
Slide 6-10
Ending an edit Session
•• Following
Following the the write
write request,
request, the
the cursor
cursor returns
returns to to
Education
Stratus
Ending an Edit Session
ready 12:52:15
• The Editor displays a message when you try to quit without writing the
most recent changes:
Slide 6-11
Results from an edit session
•• Backup
Backup file.
file.
ready:
ready: list
list
Files:
Files: 3,
3, Blocks:
Blocks: 33
ww 11 _edit.t13.7
_edit.t13.7
ww 11 letter
letter
ww 11 letter.backup
letter.backup
Education
Stratus
Results from the Editor
• The system records all of the keystrokes for this edit session in a
specific keystrokes file named: edit.<terminal_name> .
This file can be used to recover the edit session in case the file is not
closed properly. (Procedure covered in Chapter 8.)
Note: The operating system only stores one backup per file.
Also, it only creates a backup file if the file-name is
25 characters or less.
EDITOR REQUESTS
ACTIVITY REQUEST
Enter a new line [RETURN]
VOS COMMANDS
ACTIVITY COMMAND
ARGUMENTS
Call the editor edit (3) file name
Purpose: To use edit requests to create, save, and modify files, and
also to view the results in your home directory.
________________________________________
c. Move around with the arrow keys and use the [RETURN] key to
add a blank line between paragraphs.
d. Use the on-line help facility to get some help on the following two
edit functions: [DEL] and [MENU] W.
Note: This will return you to your document after each execution.
e. Save the document with the name job1 and quit the edit session.
____________________________________________
3. This time, create a file by invoking the editor with the name of a file that
does not exist, such as job2.
a. Does the pathname to this default file show on your screen below
the solid line? ______________________
__________________________________________
e. Write (save) this file to disk keeping the default file name.
Then quit the editor.
______________________________
4. Modify the file job1 that you created a moment ago by invoking the
editor with the name of this existing file.
c. Save this file with the default name (job1) and quit the edit
session.
____________________________________________________
Slide 7-1
303 - VOS Fundamentals
Chapter 7
Editing
Editing Text
Text using
using edit
edit
Education
Stratus
Slide 7-2
Objectives
Education
Stratus
Objectives
When you're using the editor, file manipulation is easy. With it, you can quickly
insert, modify, or just view text. You can also move easily through a buffer by
combining the arrow keys with other keys, or you can use it to set up columns,
then manipulate that data.
Slide 7-3
Moving the Cursor
•• You
You can
can move
move the
the cursor
cursor by
by groups
groups of
of characters.
characters.
•• AA line
line is
is aa group
group of
of characters
characters which
which ends
ends with
with aa
line-separating
line-separating character.
character.
•• A
A screen
screen is
is the
the display
display area
area for
for text.
text.
Education
Stratus
Moving the Cursor
• Word
• Line
• Screen
Note: For Stratus V103 terminals, the [HOME] key serves as the [GOTO]
Slide 7-4
ARROW KEYS
LEFT R IG H T
B E G IN N IN G END
O F L IN E G O TO O F L IN E G O TO
BOTTOM OF TOP OF
SCREEN G O TO SCREEN G O TO
P R E V IO U S NEXT
SCREEN S H IF T SCREEN S H IF T
B O T T O M O F F IL E T O P O F F IL E
G O TO LIN E G O TO LIN E
Education
Stratus
ARROW KEYS
• Scrolling a half-screen
- If you press the up-arrow key when the cursor is on the first line of
the screen, the text will scroll down ten lines.
- If you press the down-arrow key when the cursor is on the last line
of the screen, the text will scroll up ten lines.
Slide 7-5
Line Numbers
•• To
To move
move directly
directly to
to aa Line:
Line:
–– [GOTO]
[GOTO] [[ LINE]
LINE] Line
Line number:
number:
•• To
To move
move directly
directly to
to aa Column:
Column:
–– [GOTO]
[GOTO] [COLUMN]
[COLUMN] Column
Column number:
number:
Education
Stratus
Line Numbers
• To display the file with line numbers, use [MENU] [N] to toggle
line numbers ON/OFF.
Note: Line numbers only show up on the screen display. If you want
your file to print with line numbers, use the -line_numbers
argument of the print command.
• You can move the cursor directly to a specific line in the text.
• You can move the cursor directly to a specific column in the text.
Slide 7-6
Scrolling Text
•• Several
Several lines:
lines:
[REPEAT]
[REPEAT]
Number
Number of
of times:<Enter
times:<Enter number>[RETURN]
number>[RETURN]
[SCROLL]
[SCROLL] [up
[up arrow/down
arrow/down arrow]
arrow]
Education
Stratus
Scrolling Text Up or Down
You can move characters and lines that are outside of the display area into view.
• Scrolling the text up or down allows you to see the text that is just above
or just below the display area.
Slide 7-7
Scrolling Text (cont)
–– Several
Several characters:
characters:
[REPEAT]
[REPEAT]
Number
Number of
of times:<Enter
times:<Enter number>
number> [RETURN]
[RETURN]
[SCROLL] [right arrow/left arrow]
[SCROLL] [right arrow/left arrow]
Education
Stratus
Scrolling Text Left or Right
• You can move the text that is outside the screen area, to the left or the
right, into view.
Note: When the cursor is outside the width of the screen, a message line
displays the number of characters off the screen.
Slide 7-8
Search for Text
•• Search
Search for
for the
the exact
exact match
match of
of aa string.
string.
Education
Stratus
Search for Text
A search string is the sequence of characters (including spaces) that you are trying
to locate.
• The search begins at the current cursor position and searches to the top
of the file or to the bottom of the file. The search stops at the first
occurrence of the string.
Slide 7-9
Global Search and Replace
•• case-by-case
case-by-case replacement
replacement
[MENU]
[MENU] [G]
[G]
[QUERY]
[QUERY]You will
You will be
be queried
queried for
for each
each occurrence.
occurrence.
Original
Original string:
string:
New
New string:
string:
Education
Stratus
Global Search and Replace
You can replace every occurrence of one string in the text with another string.
• You can replace every occurrence of a string from the current cursor
position to the end of the buffer.
Slide 7-10
Marking Text
•• To
To make
make the
the marked
marked text
text into
into aa region:
region:
[MARK]
[MARK] (move
(move cursor
cursor over
over text
text to
to highlight
highlight it)
it)
[REGIONAL]
[REGIONAL]
[MENU]
[MENU] [G]
[G]
Education
Stratus
Marking Text
• To work with a section of text, you need to the MARK (select) the text.
- Start the selection with the [MARK] key. Use the [ARROW KEYs] to
select the text. As the cursor moves over the text, the marked text will
be displayed in reverse video.
• To make global changes within the marked text, make the marked text
into a region with the [REGIONAL] key. Now a regional Search and
Replace can be done within the selected text.
Slide 7-11
Altering Text
•• Changing
Changing Case
Case
[Change
[Change case]
case] [arrow
[arrow key(s)]
key(s)]
UP arrow for uppercase
UP arrow for uppercase
DOWN
DOWN arrow
arrow for
for lowercase
lowercase
Education
Stratus
Altering Text
Insert/Overlay
You can modify text in the text buffer by inserting or by overwriting the text.
• The insert mode (default mode) adds characters at the cursor position.
• The overlay mode replaces the character at the cursor position.
• [Menu] [O] toggles between insert mode and overlay mode.
• The function key [INSERT/OVERLAY] does the same as [MENU] O.
Changing Case
• The [CHANGE CASE] key and the up/down arrow key will change the
case of the current character at the cursor position.
• To change the case of a whole word, use [WORD] [CHANGE CASE] and
an up/down arrow key.
Slide 7-12
Moving and Copying Text
•• Deleting
Deleting and
and Saving
Saving Text
Text
•• Displaying
Displaying the
the Stack
Stack
–– [MENU]
[MENU] [1]
[1]
•• Retrieving
Retrieving Text
Text
–– [INSERT
[INSERT SAVED]
SAVED]
Education
Stratus
Moving and Copying Text
• To move or copy text, the text must first be written to a work area called
the Stack or the Status Buffer.
• The editor writes text to the Stack using the [DELETE] or [SAVE] key.
[MARK][arrow keys][SAVE]
• To display the contents of the Status Buffer (Stack), use: [MENU] [1]
• To move the cursor from the stack back to the current text buffer, use:
[CANCEL]
Slide 7-13
Displaying the Status Buffer
* (default): %class#d01>VOS_Fundamentals>vf1>abc
DELETE
bbbbbbbbbb
SAVE
CCCCCC
Education
Stratus
Displaying the Status Buffer
• To retrieve text from the stack (Status Buffer), use: [INSERT SAVED]
- The Editor inserts the text, that was saved or deleted, at the current
cursor position.
• The [INSERT SAVED] key will always retrieve the last [SAVE] or
[DELETE] request.
• To retrieve a different item from the stack, the last item on the stack must
be discarded using the [DISCARD] key.
Slide 7-14
Formatting Text - Tabs
Education
Stratus
Formatting Text
Tabs
• Use the [TAB] key to move the cursor along the line according to the tab
stops.
Slide 7-15
Tabs
•• To
To add
add new
new tabs
tabs on
on the
the tab
tab definition
definition line
line ::
–– Enter
Enter [>]
[>] (greater-than)
(greater-than)
Education
Stratus
Tabs (continued)
• Tabs on the Tab Definition Line may be deleted by spacing over them or
using the keys:
[BACKSPACE] or [DEL]
• Tabs only stay for this edit session. When you exit the Editor, the Tabs
go back to the default.
Slide 7-16
Formatting Text - Backtab
Education
Stratus
BACKTAB
The [BACKTAB] key on the terminal allows the cursor to move quickly from one
column to another.
• Before using this feature, you have to set up the spacing for the first line
of data. [BACKTAB] positions are determined by the previous line with
characters.
• [BACKTAB] looks for the first letter of words on the preceding line.
• For PCs and V103 terminals, the [SHIFT -TAB] is the [BACKTAB].
Slide 7-17
Columns
Education
Stratus
Columns
ACTIVITY REQUEST
Move through the buffer [SHIFT] ARROW KEY
[GOTO] ARROW KEY
[GOTO] [LINE] ARROW KEY
[WORD] ARROW KEY
a. Use the arrow keys to move up, down, right and left in this file until
you feel comfortable.
b. Now, press the [GOTO] key followed by an arrow key to move in one
of four directions on the screen. (Be sure to try them all.)
d. Move to the bottom line in the screen and press the down arrow.
What happened? _______________________________________
e. Move to the top line of the screen and press the up arrow. What does
this do? _________________________________________
f. What happens when you press the [SHIFT] and down arrow together?
_____________________________
g. What happens from any cursor position in the screen when you press
the [SHIFT] and up arrow simultaneously?
h. Use the [GOTO] and [LINE] function key to position the cursor on
the last line of the file. What number is it? _______
i. Now use the [GOTO] and [LINE] function key to move back to the
beginning of the file.
d. When you are finished, quit this edit session without saving the
changes.
4. Use the Saved-Text Stack feature of the editor to unscramble the steps of
the file, scrambled_turkey, in your directory.
Optional
6. Edit the file, overlay, in your directory and follow the instructions in the file.
7. To get some experience in changing the default tab settings of file, edit the
file, tab_lab, in your directory and follow its instructions.
Slide 8-1
303 - VOS Fundamentals
Chapter 8
Edit
Edit Timesaving
Timesaving Techniques
Techniques
Education
Stratus
Slide 8-2
Objectives
Education
Stratus
Objectives
This chapter covers some of the techniques that make editing easier for you. This
section demonstrates how to combine basic techniques to create shorthands, bring
several files into one edit session, and to issue system commands without leaving
your edit session.
Slide 8-3
Shorthands
•• Shorthands
Shorthands
–– A
A shorthand
shorthand is
is aa series
series of
of keystrokes
keystrokes that
that execute
execute as
as
one request.
one request.
Education
Stratus
The Menu Screen Shorthands
• You can toggle the [MENU] screen ON and OFF. You may choose to do
this because you're dialing in over a modem and you want to speed up the
process or simply because you find it distracting
Shorthands
Slide 8-4
Defining a Shorthand
1.
1. Start
Start the
the shorthand.
shorthand.
2.
2. Enter
Enter keystrokes.
keystrokes.
3.
3. End
End and
and save
save the
the shorthand.
shorthand.
Education
Stratus
Defining a Shorthand
[DEFINE SHORTHAND]
Defining shorthand. <--- msg seen on the 25th status line
[DEFINE SHORTHAND]
Shorthand name (1 character): <-- type in a single character
Slide 8-5
Defining a Shorthand (cont)
•• Create
Create only
only the
the shorthand_definitions
shorthand_definitions
file.
file.
Education
Stratus
Defining a Shorthand (continued)
- Once you have created a shorthand, you can use it in any of your
edit sessions.
Executing a Shorthand
Slide 8-6
303 - VOS Fundamentals
•• Executing
Executing aa Shorthand
Shorthand
•• Beginning
Beginning an
an edit
edit Session
Session with
with aa Shorthand
Shorthand
Education
Stratus
Executing a Shorthand
• You execute the shorthand by following the editor request with the
shorthand name. [SHORTHAND] shorthand_name
Modifying Shorthands
Note: The only times you would need to do this is to imbed a hex value or to
capture [MENU] Q.
Steps to building a shorthand to both write and quit from an edit buffer.
1. Bring any file into an edit buffer and make a change (just hitting a carriage
return to add a new-line character is a sufficient enough change).
2. Issue the [DEFINE-SHORTHAND] edit request. Then use the [MENU] [W]
request. When prompted for the file name, just hit [CARRIAGE RETURN] to
write the file to its original name. Issue the [DEFINE-SHORTHHAND] again and
when prompted, name the shorthand 'q'. Then quit from the edit.
4. Issue the menu request, [MENU] [L] (Insert literal), then [MENU] [Q].
Slide 8-7
Defining Multiple Buffers
•• Create
Create Several
Several Buffers
Buffers for
for Existing
Existing Files
Files
* * STATUS * *
Education
Stratus
Defining Multiple Buffers
You may use multiple buffers to edit several files during the same edit session.
• You can create several buffers by specifying the file names that you wish
to edit on the command line.
• The operating system creates a buffer for each file and gives each buffer
the same name as the file, except for the default buffer (which has the
buffer name (default)).
• The status buffer displays the list of buffers in use: [MENU] [1]
Slide 8-8
Create a New Buffer
•• Create
Create aa New
New Buffer
Buffer
Education
Stratus
Move to an Existing Buffer Create a New Buffer
• You can move the cursor between existing buffers with a menu request.
Slide 8-9
Read a File into a Buffer
•• Create
Create aa New
New Buffer
Buffer and
and Read
Read in
in aa File
File
Education
Stratus
Read a File into a Buffer
• You can create an empty buffer with a short name by using [MENU] B,
then read in a file using [MENU] R. (This works well when the file
name is very long or it's a mix of upper and lower case characters.)
• You can create a new buffer and read a file into it in one operation.
[MENU] C =======> Change buffer and read
Input path name: (Buffer name will be file name)
Slide 8-10
Save Buffer Contents
•• Save
Save the
the Contents
Contents of
of aa Buffer
Buffer
Education
Stratus
Accessing Text between Buffers
• You can retrieve text copied to the stack regardless of which buffer it was
saved from. Move to another buffer and insert text from the stack.
• If you attempt to exit the edit session without saving a modified buffer,
the editor will prompt you:
• The status buffer [MENU] [1] displays an asterisk (*) for each modified
buffer not yet written to disk.
• With multiple buffers, you must move into each buffer to save its
contents to a file.
Describing Windows
• You can define windows to see different views of the same buffer.
Create Windows
At any time, you can use the editor requests to create more windows.
• Within the edit session, move the cursor to where you want to create the
window.
• If you would like to start the edit session with multiple windows, on the
command line, use the keyword argument –num_windows and the
specific number of windows that you wish to open.
Moving to a Window
• To move to a window:
• To associate the window with an edit buffer, type in a buffer name at the
prompt. If the buffer doesn't exist, the editor will create one.
• Whenever you would like to see a different buffer, you can execute
[MENU] [B] and the "new" buffer is displayed in the window.
Deleting a Window
[DELETE][WINDOW]
Slide 8-11
while in edit
•• Execute
Execute Commands
Commands and
and Continue
Continue
•• Interrupt
Interrupt the
the edit
edit Session
Session to
to Execute
Execute Commands
Commands
Education
Stratus
Executing System Commands and Waiting
While you are in the editor, you can execute system commands without leaving the
edit session.
- The Editor displays the name of the buffer that contains output
from the command.
Command is executing; output will be placed in buffer C#N.
Note: N is a number.
- The system notifies you on the 25th status line when the command
is done.
• While you are in the editor, you can temporarily suspend the editor and
execute system commands
[INTERRUPT]
Slide 8-12
Keystroke Recovery
•• You
You lose
lose your
your modem
modem connection.
connection.
•• Someone
Someone shuts
shuts the
the system
system down
down without
without warning
warning
people.
people.
Keystroke Recovery
While you are in the editor, you might accidentally lose your data.
• If you went to quit and answered y (yes) instead of n (no) to the question
about leaving without writing.
What is a keystroke file. A keystroke file is a file created in your home directory
called _edit.terminal_name. Terminal_name is based on the terminal you are
logged into at the time of the edit session. There is one keystroke file per terminal
for every edit session you have. The following steps will allow you to recover
your edit session.
1. Find out your terminal name and compare it to the appropriate keystroke file.
display_line (terminal_name)
%educ#t11.5
ready 16:24:02
ls _edit*
Files: 2, Blocks: 2
w 1 _edit.t11.5
w 1 _edit.vterm.1.2
w 1 _edit.os.telnet1.3.1
3. Edit the file fix.cm and add the following lines at the beginning of the file.
&attach_input
edit <name of file that needs recovery>
&control off
Note: In Step 3, you may also need to modify the keystroke file.
For example, if the last request is to quit the edit session,
then when you recover the session, you'll just quit again.
COMMANDS
ACTIVITY COMMAND ARGUMENTS
Execute shorthand edit -initial_shorthand
EDITOR REQUESTS
ACTIVITY REQUEST
Enable/Disable the [MENU] display [MENU] A
Define a shorthand [DEFINE SHORTHAND]
Insert a menu request as is [MENU] L
Execute shorthand [SHORTHAND]
1. First, list the files in your directory to see if you have a file named
shorthand_definitions. Is it there? ____________________
5. There are four sample files in your directory named: trout_almondine, rice,
asparagus, and tarts. Use [MENU] R to combine them all into a new file
called dinner.
b. Once you are finished, save the modified buffer under the title of
addresses_names.
c. Quit the edit session and print out a copy of the file,
addresses_names, to be sure you performed the steps correctly.
Optional
Use the -num_windows argument of the edit command to load the files,
bad.cobol and bad.error, into two separate windows on the screen.
(Be sure that bad.cobol is in the default buffer before you continue with the
following tasks.)
c. Go to the bottom window and scroll the file up so you can see more
errors.
8. Invoke the editor with the name of a non-existing file called new.
b. Through the Request Menu, select the editor request to wait for the
output then execute the appropriate system command to make the
above statement true.
c. Use the Saved-Text Stack and multiple buffer features to copy a list of
your files into your default buffer.
d. Once you have done this, position the cursor at the end of new, and
type in the following statement: These are abbreviations that I can
use on the command line.
e. Through the Request Menu, select the function that lets you continue
working in your file. Execute the appropriate system command.
f. When you are ready, go to the buffer that contains the abbreviations.
Use the Saved-Text Stack and multiple buffer features to copy this
display into your default buffer.
9. Edit one of your files and make some changes, then quit with out saving.
Now recovery your edit session.
(Hint don't forget to remove the last set of keystrokes you did!!!)
10. Edit the file, exercise3, and follow its instructions. When you have
finished, quit the file.
Slide 9-1
303 - VOS Fundamentals
Chapter 9
Using
Using the
the Abbreviations
Abbreviations Facility
Facility
Education
Stratus
Slide 9-2
Objectives
Education
Stratus
Objectives
Students can tailor the system to their own liking by creating abbreviations for
command names, file names, command functions, command arguments, and even
entire command lines. Thus, the student can save on typing, effectively change
defaults of commands, and execute several commands by typing in an abbreviation
on the command line.
Slide 9-3
User Abbreviations
•• Simplifies
Simplifies typing
typing long
long sequences
sequences
Education
Stratus
User Abbreviations
Note: VOS does not support abbreviations within abbreviations. That is,
abbreviations may not be used recursively (nested).
Slide 9-4
Abbreviations Replacement
User Memory
Abbreviations Table
Command ...
Processor ...
lpr by list_print_requests
...
Education
Stratus
Abbreviations Replacement
The command line may contain one or more tokens. Any token on the command
line can be abbreviated.
Before executing a command line, the Command Processor compares every token
on the command line against the abbreviations table in user memory. If there are
abbreviations, they are replaced with the definition of the abbreviation.
Slide 9-5
Abbreviations Processing Steps
1.
1. Define
Define your
your abbreviation.
2.
2. Activate
Activate the
the abbreviations
abbreviations file.
file.
use_abbreviations
use_abbreviations
3.
3. Use
Use the
the abbreviation(s)
abbreviation(s) on
on the
the command
command line.
line.
Education
Stratus
Abbreviations Processing Steps
Definition format:
Go to next page.
Slide 9-6
Types of Tokens
first subsequent
all
Education
Stratus
Types of Tokens
Slide 9-7
The Type first Abbreviation
•• A
A type
type first
first abbreviation
abbreviation replaces
replaces the
the first
first token
token
•• An
An abbreviation
abbreviation may
may contain
contain multiple
multiple VOS
VOS
commands
commands separated
separated by
by aa semi-colon.
semi-colon.
first
first show
show by
by display_line
display_line Here
Here are
are your
your files;list
files;list
Cmd
Cmd line:
line: show
show
Result:
Result: display_line
display_line Here
Here are
are your
your files;list
files;list
Education
Stratus
The Type first Abbreviation
• A type first abbreviation replaces the first token on the command line
(but not any later occurrences).
first d by display
d phone_file
- Replacement:
display phone_file
show
- Replacement:
Slide 9-8
Abbreviation
•• AA subsequent
subsequent abbreviation
abbreviation is is replaced
replaced only
only when
when
Abbrev:
Abbrev: subsequent
subsequent -m
-m by
by -match
-match
Cmd
Cmd Line:
Line: help -m print
help -m print
Result:
Result: help
help -match
-match print
print
Education
Stratus
The Type subsequent Abbreviation
subsequent t by (time)
display_line t
- Replacement:
display_line (time)
subsequent -m by -match
help -m print
- Replacement:
Slide 9-9
The Type all Abbreviation
•• The
The type
type all
all abbreviation
abbreviation replaces
replaces the
the token
token no
no
Abbrev:
Abbrev: all
all stu
stu by
by start_up.cm
start_up.cm
Cmd
Cmd line:
line: stu
stu
Result:
Result: start_up.cm
start_up.cm
OR
OR
Cmd
Cmd line:
line: display
display stu
stu
Result:
Result: display
display start_up.cm
start_up.cm
Education
Stratus
The Type all Abbreviation
• The type all abbreviation replaces the token no matter where the token is
on the command line.
stu
- Replacement:
start_up.cm
Or
display stu
- Replacement:
display start_up.cm
Slide 9-10
Arguments to Abbreviation
–– On
On the
the command
command line:
line:
pp greetings.list
greetings.list -copies
-copies 22 -line_numbers
-line_numbers -defer_until
-defer_until 20:00
20:00
–– Replacement:
Replacement:
print
print greetings.list
greetings.list -copies
-copies 22 -line_numbers
-line_numbers -defer_until
-defer_until 20:00
20:00
Education
Stratus
Passing Command Line Arguments to an Abbreviation
Slide 9-11
Arguments to Abbreviation
–– On
On the
the command
command line:
line:
pf
pf start_up.cm
start_up.cm
–– Replacement:
Replacement:
print
print start_up.cm
start_up.cm -defer_until
-defer_until 20:00;
20:00; list_print_requests
list_print_requests -all
-all
Education
Stratus
Passing Command Line Arguments to an Abbreviation (continued)
- &1& parameter for the first token on the command line after the
abbreviation.
- &3& parameter for the third token on the command line after the
abbreviation.
Slide 9-12
Arguments to Abbreviation
•• Multiple
Multiple parameters
parameters in
in an
an abbreviation
abbreviation definition
definition
–– On
On the
the command
command line:
line:
prc
prc log.96-09-04
log.96-09-04 55
–– Replacement:
Replacement:
print
print log.96-09-04
log.96-09-04 -line_numbers
-line_numbers -copies
-copies 55 -defer_until
-defer_until 20:00
20:00
Education
Stratus
Passing Command Line Arguments to an Abbreviation (continued)
• If there are more tokens on the command line than there are place-holders
in the abbreviation, all extra tokens will be ignored.
Slide 9-13
Command Line
•• One
One parameter
parameter can
can pick
pick up
up the
the remaining
remaining tokens
tokens
–– On
On the
the command
command line:
line:
prc2
prc2 log.96-09-04
log.96-09-04 55 -notify
-notify
–– Replacement:
Replacement:
print
print log.96-09-04
log.96-09-04 -line_numbers
-line_numbers -copies
-copies 55 -notify
-notify ;;
list_print_requests
list_print_requests
Education
Stratus
Collecting Arguments from the Command Line
• You can designate one parameter to pick up the remaining tokens on the
command line starting with a particular argument by inserting an f before
the parameter number for that argument (&fn&).
Parameters in Multiple
Slide 9-14
Command Abbreviations
•• Multiple
Multiple commands
commands in
in an
an abbreviation.
abbreviation.
–– On
On the
the command
command line:
line:
dp
dp phone
phone -line_numbers
-line_numbers
–– Replacement:
Replacement:
display
displayphone;
phone; print
print phone
phone -line_numbers;
-line_numbers;
list_print_requests
list_print_requests -all
-all
Education
Stratus
Multiple Command Abbreviation
Slide 9-15
Command Line
•• Two
Two competing
competing arguments
arguments on
on the
the command
command line.
line.
–– On
On the
the command
command line
line
pl
pl phone_file
phone_file -no_line_numbers
-no_line_numbers
–– Replacement:
Replacement:
print
print phone_file
phone_file -line_numbers
-line_numbers -no_line_numbers
-no_line_numbers
Education
Stratus
Competing Arguments on the Command Line
• If there are two competing arguments are on the command line, the last
one is the effective one.
Slide 9-16
Abbreviations
Exclamation
Exclamation point
point
dd !stu
!stu
Single
Single quotes
quotes
dd ‘stu’
‘stu’ -m
-m notices
notices
Education
Stratus
Controlling the Use of Abbreviations
use_abbreviations -off
d !stu
(will use a file named stu without checking the abbreviations table for
a replacement)
- The abbreviations are suppressed from that point to the end of the
command line
• Use ' ' (single quotes) around the token if you only want to suppress that
one token instead of the entire command line
d 'stu' -m notice
use_abbreviations (5)
Remember
first (8)
subsequent(10)
all (12)
7. Edit your abbreviations file to add the abbreviation prc that will print a file.
The abbreviation should accept input parameters for the file name and the
number of copies.
Optional
10. Create an abbreviation that will edit any abbreviations file and will then
activate the same abbreviations file.
Slide 10-1
303 - VOS Fundamentals
Chapter 10
The
The Attributes
Attributes and
and Resources
Resources of
of aa User
User Process
Process
Education
Stratus
Slide 10-2
Objectives
•• List
List the
the attributes
attributes and
and resources
resources
Education
Stratus
Objectives
When you log into the system, your user_name is assigned to a process. This
defines your interaction with the system. In order to better understand other parts
of the system, it is necessary to know about the attributes and resources of a user
process. In this chapter, the student will look conceptually at a process.
Slide 10-3
Stratus User Process
•• Attributes
Attributes of
of aa process
process
Education
Stratus
Stratus User Process
When you log in, your user_name is assigned to a process. The user process is
terminated by the command, logout. The user process is your identity to the
Stratus system. How the system shares the work environment with you is affected
by your identity. Being a user process is like having a virtual computer.
Slide 10-4
Process Priority and the CPU
P ro c e s s S c h e d u le r Lo o p
Running Waiting
Education
Stratus
Process Priority and the CPU
• The attribute, process priority, determines how much CPU time your
process will get and when your process gets this time.
Slide 10-5
Process Priority and the CPU
•• Check
Check process
process priority
priority
ready:
ready: list_users
list_users -admin
-admin usage
usage -interval
-interval 10
10
•• Change
Change process
process priority
priority
ready:
ready: set_priority
set_priority [DISPLAY
[DISPLAY FORM]
FORM]
----------------------
---------------------- set_priority ---------------
set_priority ---------------
priority:
priority: 5
5
process_name:
process_name:
–user:
–user: vf1.VOS_Fundamentals
vf1.VOS_Fundamentals
Education
Stratus
–module:
–module:
-ask:
-ask: no
no
• The user can check their current process priority two ways:
Slide 10-6
Directory Structure
#d101
VOS_Fundamentals VOS_Programmer
person directories
Education
Stratus
User Name and Access to the Directory Structure
(user_name) = (person_name).(group_name)
display_line (user_name)
Slide 10-7
Directory Structure
Education
Stratus
User Name and Access to the Directory Structure (continued)
display_line (home_dir)
• The disk is structured into directories for easy management and security.
Slide 10-8
login Command
Education
Stratus
The login Command
• As a user logins into the system, the following attributes may be changed.
- password:
Slide 10-9
Other Resources - Memory
External Commands
Internal Commands Abbreviations
User programs
Education
Stratus
Other Resources - Memory
Slide 10-10
The I/O Connection
Education
Stratus
The I/O Connection (continued)
Slide 10-11
list_port_attachments
default_input
default_input(1)(1)
Indirects
Indirectstototerminal
terminal_output
terminal_output(2) (2)
Indirects
Indirectstototerminal
terminal
command_input
command_input(3) (3)
Indirects
Indirectstototerminal
terminal
default_output
default_output(4) (4)
Indirects
Indirectstototerminal
terminal
terminal
terminal(5)
(5)
Pathname:
Pathname: %ed31#telnet.1.0
%ed31#telnet.1.0
Type:
Type: window
windowterminal
terminal
I/O type: output
I/O type: output
Access mode: sequential
Access mode: sequential
Attributes:
Attributes: wait
waitmode,
mode,hold
holdattached
attachedand
andopen
open
_aaac0cGQGpGaWiE5
_aaac0cGQGpGaWiE5(7) (7)
Pathname:
Pathname: %ed31#d101>system>error_codes.text
%ed31#d101>system>error_codes.text
Type:
Type: sequential
sequentialfile
file
I/O
I/Otype:
type: input
input
Access
Accessmode:
mode:indexed
indexed
Attributes:
Attributes: wait wait mode,
mode, hold
hold attached
attached and
and open
Education
open
Stratus
• Use the list_port_attachments (lpa) command to see the ports in use
by your process.
• VOS-predefined ports:
• The first four predefined ports above are connected to the terminal.
• VOS uses one port to reference the error text file for error messages.
- This file contains the error messages for each error code.
Slide 10-12
The I/O Connection
•• The
The default_output
default_output port port can
can be
be directed
directed to
to aa file
file
•• To
To reattach
reattach the
the default_output
default_output
ready:
ready: detach_default_output
detach_default_output
Education
Stratus
The I/O Connection (continued)
- default_input
- command_input
- default_output
Slide 10-13
Subprocesses
Sub-
process 1
(ready)
Education
Stratus
Subprocesses
Slide 10-14
Subprocesses
•• A
A user
user creates
creates aa subprocess
subprocess by:
–– [INTERRUPT]
[INTERRUPT] key
key from
from aa CRT
CRT form
form
–– from
from directives
directives within
within edit
edit or
or emacs
emacs
•• in
in edit
edit [INTERRUPT]
[INTERRUPT] keykey
•• in
in emacs
emacs ^X-L
^X-L key
keysequence
sequence
Education
Stratus
Subprocesses (continued)
- login command
from [CTRL-BREAK]
BREAK
Request? (stop, continue, debug, keep, login, re-enter)
login
Subprocesses (continued)
Slide 10-15
Subprocesses
•• The
The users
users can
can check
check on
on their
their processes.
processes.
–– command
command functions:
functions:(process_type) and
(process_type) and
(process_info
(process_info sub_process_level)
sub_process_level)
ready:
ready: display_line
display_line (process_type)
(process_type)
sub_process
sub_process
ready:
ready: display_line
display_line (process_info
(process_info sub_process_level)
sub_process_level)
11
Education
Stratus
Subprocesses (continued)
attach_default_output (12)
detach_default_output (12)
list_port_attachments (11)
list_users(5)
login (8)
set_priority (5)
(group_name)(6)
(home_dir) (7)
(person_name) (6)
(process_info args) (5)
Argument values:
priority (5)
privileged (16)
sub_process_level (16)
(process_type) (16)
(user_name) (6)
person_name
privileged status
Change it to priority 2.
a. Do the following:
5. Execute either the emacs or edit commands. From within either editor:
Optional
8. Create a subprocess and then check the process type of your subprocess.
Slide 11-1
303 - VOS Fundamentals
Chapter 11
Batch
Batch and
and Started
Started Processes
Processes
Education
Stratus
Go to next page.
Slide 11-2
Objectives
Education
Stratus
Batch and Started Processes
Commands and programs can execute without using a terminal. In this section,
you learn to manage non-interactive processes while freeing up the terminal for
other processes.
Slide 11-3
login
sub_process
started batch
process process
Education
Stratus
Differences Between Process Types
started_process: immediate
Slide 11-4
The start_process Command
•• The
The start_process
start_process command
command
start_process
start_process ‘locate_files
‘locate_files *.cm
*.cm -root_dir
-root_dir (master_disk)’
(master_disk)’
Slide 11-5
The batch Command
•• The
The batch
batch command
command
Education
Stratus
-cpu_limit:
-cpu_limit:
-notify:
-notify: no
no
cancel_batch_requests count_25
stop_process count_25
batch (8)
cancel_batch_requests, (cbr) (9)
list_batch_requests, (lbr) (9)
list_users, lu (7)(9)
start_process (6)
stop_process (7)(9)
update_batch_requests (9)
Purpose: Use the various batch and start process commands to execute and
monitor your batch processes.
1. Using the batch command, execute a command line that will list the files in
your home directory. When the job finishes, examine the output file to
verify that everything executed successfully.
2. Using the batch command, execute a command line that will display the file
tarts. Defer this batch process for at least one hour from the current time.
Optional
____________________________________________
When the process finishes, examine the output file for the results.
Slide 12-1
303 - VOS Fundamentals
Chapter 12
Command
Command Macros
Macros II
Education
Stratus
Command Macros I 12 - 1
VOS Fundamentals 303 Stratus®
Slide 12-2
Objectives
•• Implement
Implement aa command
command macro
macro which
which executes
•• Implement
Implement aa command
command macro
macro which
which branches
branches on
on
aa condition.
condition.
•• Implement
Implement aa command
command macro
macro which
which executes
executes aa
program
program module
module or
or another
another command
command macro.
macro.
Education
Stratus
Objectives
When you have a set of commands that execute often, it is convenient to save that
sequence to be repeated many times. In this chapter, you will learn how to create
and use command macros.
12 - 2 Command Macros I
Stratus® VOS Fundamentals 303
Slide 12-3
Simple Command Macros
1 & simple.cm
2 &
Education
Stratus
Simple Command Macros
Command Macros I 12 - 3
VOS Fundamentals 303 Stratus®
Slide 12-4
Continuation of Lines
1 & continuation.cm
2 &
Education
Stratus
Continuation of Lines
• If a space is necessary for correct syntax, place the space before the &+.
12 - 4 Command Macros I
Stratus® VOS Fundamentals 303
Slide 12-5
display_line vs &display_line
1 & display_line.cm
2 &
Education
Stratus
display_line statement vs. &display_line command
• display_line:
• &display_line:
Command Macros I 12 - 5
VOS Fundamentals 303 Stratus®
Slide 12-6
Macro Condition Statements
1 & condition.cm
2 &
Education
Stratus
Macro Condition Statements
12 - 6 Command Macros I
Stratus® VOS Fundamentals 303
Slide 12-7
Using nested &if
1 & nested_if.cm
2 &
Education
Stratus
Macro Condition Statements (continued)
• Nested &if statements allow the layering of multiple &if statements.
Note: Requires VOS 12.2 or higher.
Command Macros I 12 - 7
VOS Fundamentals 303 Stratus®
Slide 12-8
Using do-group
1 & do_group.cm
2 &
Education
Stratus
Macro Condition Statements (continued)
12 - 8 Command Macros I
Stratus® VOS Fundamentals 303
Slide 12-9
Changing the Flow of Execution
1 & execution_flow.cm
2 &
Education
Stratus
Changing the Flow of Execution
+ (add), - (subtract),
* (multiply), / (divide),
= (equal to), ^= (not equal to),
> (greater than), < (less than),
& (and), | (or).
Command Macros I 12 - 9
VOS Fundamentals 303 Stratus®
Slide 12-10
Programs and other Macros
1 & pm_cm_macro.cm
2 & Programs and other Command Macros can be executed within a macro.
Education
Stratus
Programs and Other Macros
• When specifying program and macro names, if programs are not part of
the command search path, use the full path name including the suffix for
the file.
• Called Macro
1 & show_time.cm
2 & THIS MACRO IS EXECUTED BY PM_CM_MACRO.CM
3 &
4 display_line The time is (time -long)
5 &return
12 - 10 Command Macros I
Stratus® VOS Fundamentals 303
Command Macros I 12 - 11
VOS Fundamentals 303 Stratus®
List all the requests in the print queue (use -all arg)
2. Create a macro called view_time.cm that will display the time in long
format. Before the time prints, have a greeting message write out on the
terminal that includes your person_name.
Hints: This macro will require you to use the (person_name) and
(time -long)function
12 - 12 Command Macros I
Stratus® VOS Fundamentals 303
4. Create a command macro that will check for the existence of a file named A.
If the file exists, the macro should display "Yes, that file is here." If the file
does not exist, it should display "No, that file is not here."
Use the &label and &goto macro statements.
Test your macro by executing it when file A does not exist and when file A
does exist. Create a file named A for this purpose.
Command Macros I 12 - 13
Stratus® VOS Fundamentals 303
Slide 13-1
303 - VOS Fundamentals
Chapter 13
Command
Command Macros
Macros II
II
Education
Stratus
Command Macros II 13 - 1
VOS Fundamentals 303 Stratus®
Slide 13-2
Objectives
•• Implement
Implement aa command
command macro
macro which
which checks
checks the
the
Education
Stratus
Objectives
13 - 2 Command Macros II
Stratus® VOS Fundamentals 303
Slide 13-3
a Macro
1 & check_status_do.cm
2 &
Education
Stratus
Checking a Command's Status In a Macro
• The command status code, also known as a return code, is a number that
indicates the success of execution of a VOS command.
Command Macros II 13 - 3
VOS Fundamentals 303 Stratus®
Slide 13-4
Input to a Program
1 & lotto_script.cm
2 &
Education
Stratus
Allowing a Macro to Provide Input to a Program
• This is useful for testing programs consistently with the same data.
13 - 4 Command Macros II
Stratus® VOS Fundamentals 303
Slide 13-5
Setting Variable Values
1 & set_vars.cm
Education
Stratus
Setting Variable Values
• To use the value of a variable, refer to the variable with its name
enclosed in ampersands &variable_name&.
&display_line The value of xyz is: &xyz&
Command Macros II 13 - 5
VOS Fundamentals 303 Stratus®
Slide 13-6
Testing Variables
1 & test_vars_.cm
2 &
Education
Stratus
Testing Variables
• To test the value of an arithmetic variable, refer to the variable with its
name enclosed in ampersands: &variable_name&.
&if &counter& < 10
• To test the value of a variable which is a text string, refer to the variable
with its name enclosed in ampersands, but precede the variable name
with a $ (dollar sign): &$variable_name&.
&if &$y& = 'hello world'
&then &display_line We are out here
13 - 6 Command Macros II
Stratus® VOS Fundamentals 303
Slide 13-7
Testing Variables
1 & test_vars_while.cm
2 &
Education
Stratus
Testing Variables
• If you are running VOS 12.2 or higher, you can get the same results
using a &while/&end loop.
Command Macros II 13 - 7
VOS Fundamentals 303 Stratus®
Slide 13-8
User
1 & ask_demo.cm
2 &
Education
Stratus
17 &display_line Have a nice day &name&
18 &return
13 - 8 Command Macros II
Stratus® VOS Fundamentals 303
Using a Macro to
Slide 13-9
Read from a File
1 & read.cm
Education
Stratus
Using A Macro to Read from a File
• A variable can be set to the contents of a file (or a record from a file)
using the (contents) command function.
Command Macros II 13 - 9
VOS Fundamentals 303 Stratus®
Using a Macro to
Slide 13-10
Write to a File
1 & redirect.cm
Education
Stratus
Using A Macro to Write to a File
• Macros can write to a file by redirecting the output from the terminal to a
file with attach_default_output
13 - 10 Command Macros II
Stratus® VOS Fundamentals 303
Slide 13-11
start_up.cm Command Macro
Education
Stratus
start_up.cm Command Macro
Command Macros II 13 - 11
VOS Fundamentals 303 Stratus®
Slide 13-12
Debugging Macros
1 & debug1.cm
2 &
Education
Stratus
Debugging Command Macros
• The &echo statement will allow you see what is being passed and
executed within a macro.
&echo no_macro_lines
13 - 12 Command Macros II
Stratus® VOS Fundamentals 303
Slide 13-13
Debugging Macros
1 & debug2.cm
2 &
Education
Stratus
Debugging Command Macros (continued)
Command Macros II 13 - 13
VOS Fundamentals 303 Stratus®
Slide 13-14
Debugging Macros
1 & debug3.cm
Education
Stratus
Debugging Command Macros (continued)
13 - 14 Command Macros II
Stratus® VOS Fundamentals 303
Summary of Commands and Command Functions
Command Macros II 13 - 15
VOS Fundamentals 303 Stratus®
Execute the program giving input from your terminal as the program
requests it. (Don't use $ or comma in the amount.)
Now that you have seen the program execute, create a command macro
called purchase.cm that will supply the three appropriate answers so that
the program can receive its input from the macro rather than the terminal.
Note: The Color and Model that you entered do not display on the output of
purchase.cm.
2. Create a command macro that will count by 5's, starting at 20, and finishing
at 100. Display the value of the counter each time you add 5.
Test your macro by using &echo and &mode no_execute statements within it.
13 - 16 Command Macros II
Stratus® VOS Fundamentals 303
If your process type is interactive, the macro should ask if you want to read
the system notices file and, based on your response, the macro will
display_notices or return.
Test your macro by using &echo and &mode no_execute statements within
it.
Command Macros II 13 - 17
VOS Fundamentals 303 Stratus®
Optional
13 - 18 Command Macros II
Stratus® VOS Fundamentals 303
Command Macros II 13 - 19
Stratus® VOS Fundamentals 303
Slide 14-1
303 - VOS Fundamentals
Chapter 14
Macro
Macro Input
Input Parameters
Parameters
Education
Stratus
Slide 14-2
Objectives
•• Implement
Implement aa command
command macro
macro which
which requires
requires
Another way to pass data into a macro is through input parameters. Input
parameters allow the user to create macros that look like VOS commands and have
similar argument types as the VOS commands. In this chapter, you learn how to
define and validate input parameters.
Slide 14-3
Input Parameters
1 & PARAMETERS.CM
2 &
3 & Input parameters are used to pass command line arguments into a macro
Input Parameters
- lineal format
- CRT format by [DISPLAY FORM] or –form
- -usage option
• There are three types of parameters, just like there are three types of
command arguments:
Slide 14-4
Argument Specifiers
1 & SPECIFIERS.CM
2 &
3 & Parameters may have argument specifiers - the default specifier
date_time
module_name
pathname
name
user_name
number
string
Slide 14-5
Labels
1 & LABELS.CM
2 &
3 & Labels are used in parameter definitions to help the user fill in the
Slide 14-6
Qualifiers
1 & QUALIFIERS.CM
2 &
3 & Parameters may be further restricted with ARGUMENT QUALIFIERS.
Slide 14-7
Default Values
1 & DEFAULTS.CM
2 &
3 & Parameters may be given default values.
Slide 14-8
Option Parameters
1 & OPTION.CM
2 &
3 & Parameters may be defined as OPTION PARAMETERS.
Slide 14-9
Switch Parameters
1 & SWITCH.CM
2 &
3 & Parameters may be defined as SWITCH PARAMETERS.
• Switch parameters can use only two qualifiers: noform and hidden.
Slide 14-10
&end_parameters
1 & END_PARAMETERS.CM
2 &
3 & &end_parameters STATEMENT can have qualifiers.
&end_parameters Qualifiers
form
2col
privileged, priv
&begin_parameters (3)
&end_parameters (3)
&end_parameters qualifiers (10)
form
2col
privileged, priv
switch type input paramters (9)
option type input paramters (8)
Argument Specifiers
date_time (4)
module_name (4)
name (4)
number (4)
pathname (4)
string (4)
user_name (4)
Argument Qualifiers
allow(list) (6)
hidden (6)
length(integer) (6)
longword (6)
max(integer) (6)
min(integer) (6)
noform (6)
required (6)
word (6)
Purpose: To use an editor (either edit or emacs) to create command macros that
use various complexities of input parameter descriptions
A quantity
A price
SALES ORDER
CUSTOMER:
ITEM:
QUANTITY:
PRICE:
4. Modify your command macro to add a default value: item should default to
Paperback.
Test the macro by first giving a value to item and then not giving a value to
item.
Optional
6. Modify your command macro to calculate the total cost and display this
cost.
Total cost is calculated from (quantity * price).
SALES ORDER
CUSTOMER:
ITEM:
QUANTITY:
PRICE:
TOTAL COST:
8. Add statements to your command macro so that the date and the user_name
are displayed each time the program executes. The user_name should
appear after Clerk:. Your macro should display the information similar to
that below:
SALES ORDER
DATE:
CLERK:
CUSTOMER:
ITEM:
QUANTITY:
PRICE:
TOTAL COST:
Slide A-1
303 - VOS Fundamentals
Appendix A
For
For More
More Information
Information
Education
Stratus
Appendix A - 1
VOS Fundamentals 303 Stratus®
Appendix A
Appendix A - 2
Stratus® VOS Fundamentals 303
Slide B-1
303 - VOS Fundamentals
Appendix B
Edit/Emacs
Edit/Emacs Help
Help Sheet
Sheet
Education
Stratus
CURSOR POSITIONING
Back a character LT ARROW
Forward a character RT ARROW
Backward by word [WORD]-LT ARROW
Forward by word [WORD]-RT ARROW
Beginning of line [GO TO]-LT ARROW
End of line [GO TO]-RT ARROW
Down a line DN ARROW
Up a line UP ARROW
Top of screen [GO TO]-UP ARROW
Bottom of screen [GO TO]-DN ARROW
Next screen [SHIFT]-DN ARROW
Previous screen [SHIFT]-UP ARROW
Beginning of buffer [GO TO]-[LINE]
-UP ARROW
End of buffer [GO TO]-[LINE]
-DN ARROW
DELETING TEXT
Character [BACKSPACE]
Character [DEL]
Line [DELETE]-RT ARROW
Block [MARK]...[DELETE]
ENTERING TEXT
Carriage return [RETURN]
Tab [TAB]
Overlay/Insert [MENU]-O
FILES
Read a file [MENU]-R
Read a file [MENU]-C
Write a file [MENU]-W
GETTING HELP
Get help [HELP]
MOVING TEXT
Delete a line [DELETE]-RT ARROW
Delete a block [MARK]...[DELETE]
Retrieve text [INSERT SAVED]
Save a block [MARK]...[SAVE]
REPEATING REQUESTS
The next request [REPEAT]
The last request [REPEAT LAST]
SCREEN DISPLAY
Show line numbers [MENU]-N
Redisplay screen [REDISPLAY]
SCROLLING
Scroll text up [SCROLL]-UP ARROW
Scroll text down [SCROLL]-DN ARROW
Scroll text right [SCROLL]-RT ARROW
Scroll text left [SCROLL]-LT ARROW
SEARCHING
Global replace [MENU]-G
Search forward [SEARCH]-DN
Search backward [SEARCH]-UP ARROW
CURSOR POSITIONING
Back one character LT ARROW
Forward by character RT ARROW
Backward by word [ESC]-B
Forward by word [ESC]-F
Beginning of line ^A
End of line ^E
Down a line DN ARROW
Up a line UP ARROW
Top of screen [ESC]-A
Bottom of screen [ESC]-E
Next screen [ESC]-N
Previous screen [ESC]-P
Beginning of buffer [ESC]-<
End of buffer [ESC]->
DELETING TEXT
Character [BACKSPACE]
Character [DEL]
Line ^K
Block ^@...^W
ENTERING TEXT
Carriage return [RETURN]
Tab [TAB]
Overlay/Insert [ESC]-_
FILES
Read a file ^X-^R
Read a file ^X-^F
Write a file ^X-^W
GETTING HELP
Get help [ESC]-H
MOVING TEXT
Delete a line ^K
Delete a block ^@...^W
Retrieve text ^Y
REPEATING REQUESTS
Repeat next request [ESC]-number
SCREEN DISPLAY
Display line number [ESC]-=
Redisplay screen ^V
SCROLLING
Scroll to next screen [ESC]-N
Scroll to prev. screen [ESC]-P
SEARCHING
Global replace [ESC]-^R
Search forward [ESC]-S
Search backward ^R
Slide C-1
303 - VOS Fundamentals
Appendix C
Header
Header and
and Footer
Footer Keywords
Keywords for
for print
print Command
Command
Education
Stratus
Appendix C - 1
VOS Fundamentals 303 Stratus®
Header and Footer Keywords for print Command
* -header text
print the text on the second line from the top of each page
* -footer text
print the text on the second line from the bottom of each page
&date_time&
&file_name&
&page_number&
&user_name&
Appendix C - 2
Stratus® VOS Fundamentals 303
Slide D-1
303 - VOS Fundamentals
Appendix D
Favorite
Favorite Abbreviations
Abbreviations
Education
Stratus
Appendix D - 1
VOS Fundamentals 303 Stratus®
Favorite Abbreviations
all cd by (current_dir)
all hd by (home_dir)
Appendix D - 2
Stratus® VOS Fundamentals 303
Favorite Abbreviations (continued)
first cdd by display_line '...I assume you really meant "ccd" Fumblefingers';
change_current_dir &1&;display_current_dir
Appendix D - 3
VOS Fundamentals 303 Stratus®
Favorite Abbreviations (continued)
first q by quit
first s by step
first ss by source;step
Appendix D - 4
Stratus® VOS Fundamentals 303
Favorite Abbreviations (continued)
first wc by where_command
first wl by who_locked
subsequent -q by -queue
subsequent -u by -usage
subsequent f by -form
subsequent gn by (group_name)
subsequent tn by (terminal_name)
Appendix D - 5
VOS Fundamentals 303 Stratus®
Appendix D - 6
Stratus® VOS Fundamentals 303
Slide E-1
303 - VOS Fundamentals
Appendix E
Introduction
Introduction to
to editing
editing using
using emacs
emacs
Education
Stratus
Slide E-2
Objectives
•• Describe
Describe the
the terminal
terminal keyboard
keyboard keys.
keys.
Education
Stratus
Objectives
The emacs command is a system command that calls a Full Screen Editor and
enables you to begin editing a file. Along with the emacs requests, you need to
learn a few simple system commands that help you examine your files.
Slide E-3
Terminal Keyboard
Education
Stratus
The Terminal Keyboard
- Function keys are not used in emacs unless you assign them
- Special keys which are the keys with lettering or symbols on them.
(eg., [DEL], [ _ ]
Slide E-4
Starting an emacs session
–– ready:
ready: emacs
emacs
Education
Stratus
Starting an Emacs Session
- When you execute the emacs command, VOS positions the cursor
in a storage area known as a buffer.
- The default buffer is the initial buffer where VOS places the
cursor. This buffer is called window1
- The default buffer is empty when you do not specify the file name
on the command line.
Slide E-5
Default emacs Buffer
Working
Lines 1-20
System
(letter) %class#d101>VOS_Fundamentals>vf1>letter
Area
Status
Line
Education
Stratus
Default Emacs Buffer (continued)
• The default buffer is not used when you follow the emacs command with
the filename of a specific file on the command line. emacs will create a
buffer based on the filename
ready: emacs letter
• There are some requests which just have a command and no key
sequence.
• All commands requests are preceded by the key sequence request esc-r,
which means execute command.
• All key sequences are made up of the key esc or ctrl followed by a
character.
• In this guide, the symbol for the ctrl key is the ^ (circumflex) symbol.
Also, key sequences that represent a two pattern key sequence or an esc
are noted with a - (hyphen).
esc-r ^x-^v
Slide E-6
Termination in emacs
•• Terminating
Terminating aa request
request while
while itit is
is executing
executing
•• Terminating
Terminating emacs
emacs
Education
Stratus
Termination in emacs
- For example, when you get prompted from esc-h, you could do a
^ c and cancel that request.
Slide E-7
HELP
esc-h
esc-h
Subject:
Subject: <---
<---type
typeininaacommand
commandor
orpress
press[RETURN]
[RETURN]
Education
Stratus
Help
The Emacs help will provide a listing of the key sequences and commands.
• The request for help (esc-h) will prompt you for which request you want
help on. If you type a portion of the command, it will list all requests and
commands that match that string.
- The [RETURN] key alone will list all key sequence requests followed
by their corresponding command. Some commands may not have a
key sequence.
• All output from the help request will be placed in the help buffer. Each
time you use the help request, it will overlay the previous information in
the help buffer.
Slide E-8
Line of Text
•• End
End of
of aa line
line of
of text
text
Education
Stratus
Line of Text
- Press the [RETURN] key when you want to end a line of text or to
create a new line. Cursor will move to the next line.
Note: ^m will do the same as [RETURN].
- ^o,open_line will open a new line, but leave the cursor in the same
location.
You can modify your file by positioning the cursor and inserting or deleting.
- Key requests
^f forward a character
^b backward a character
^a beginning of line
^e end of line
^n next line
^p previous line
Naming a File
Writing a File
You issue the write request to save the contents of your text buffer.
• Emacs will write the contents of the text buffer to permanent storage in a
file when you do any of the follow steps:
• Once you have named a file, you don't have to re-enter its name when
you write it (save it to disk). The path name becomes the default name,
making it unnecessary to re-enter the name.
1. ^x-^w
• There are two key request which will do the same as the above example,
and save to the current pathname.
x-^s or ^x-^v
After you write the contents of the emacs buffer, you can either continue the emacs
session or you can exit it.
• Following the write_file request, the cursor returns to its position in the
emacs buffer.
• If you try to quit without writing the most recent changes, emacs displays
the following message:
Buffer (buffer_name) is modified Quit?
• To avoid the message, you can perform the command quit_force. All
commands are executed with the request sequence esc-r
Request? quit_force
Slide E-9
Results from an emacs session
ready:
ready: list
list
Files: 3,
Files: 3, Blocks:
Blocks: 33
ww 11 _emacs.t13.7
_emacs.t13.7
ww 11 letter
letter
ww 11 letter.backup
letter.backup
Education
Stratus
Results from Emacs
• The system saves your previous text file if you use the -backup argument
in emacs.
Note: The operating system only stores one backup copy per file and only if the
filename is 25 characters or less.
EMACS REQUESTS
ACTIVITY REQUEST
Get help esc-h
(back to original buffer) ^x-b-[CR]
forward a character ^f or ∅
backward a character ^b or ♦
beginning of line ^a
end of line ^e
next line ^n or ¬
previous line ^p or
VOS COMMANDS
ACTIVITY COMMAND
ARGUMENTS
Purpose: To use VOS commands to log onto the system and use basic commands
and emacs requests to create, save, and print files and also to view the results in
your home directory.
Begin this exercise after you receive your login name and password information
from your instructor:
a. Is there a pathname?
c. Move around with the arrow keys and use the [RETURN] key to skip a line
between paragraphs. Also try the open_line request.
d. Use the on-line help facility to get some help on the following emacs
request: write
e. Save the document your created with the name job1 and quit the emacs
session.
Note: You are not in your original buffer.
3. This time, create an emacs buffer by invoking emacs with the name of a file that
does not exist, such as job2.
a. Is there a pathname?
b. Type in a couple of paragraphs that explain what you like to do when you
are not working. Again, use [RETURN], [DEL] and [BACKSPACE] to manually
format your document as you create it.
c. When you finish, attempt to quit your emacs session without writing
(saving) the file. What does the message say?
e. Write (save) this file to disk keeping the default file name, then quit
emacs. There are 3 ways this could be done what are they?
f. List the files in your directory to be sure that job2 is there. Is it?
Why?
4. Modify the file job1 that you created a moment ago by invoking emacs using
both -keystrokes and the -backup arguments.
a. Move the cursor to the beginning of the second paragraph and insert a
new paragraph that explains what you would do if you won the lottery.
c. Save this file with the default name (job1) and quit the emacs session.
e. Display the contents of both job1 and job1.backup. What has happened?
Slide F-1
303 - VOS Fundamentals
Appendix F
Editing
Editing Text
Text using
using emacs
emacs
Education
Stratus
Slide F-2
Objectives
•• Perform
Perform efficient
efficient methods
methods of
of modifying
modifying text.
text.
•• Tabulate
Tabulate text.
text.
Education
Stratus
Objectives
When you're using emacs, file manipulation is easy. With it, you can quickly
insert, modify, or just view text. You can also move easily through a buffer by
combining the arrow keys.
Slide 7-2
Moving the Cursor
•• You
You can
can move
move the
the cursor
cursor by
by groups
groups of
of characters.
characters.
•• AA line
line is
is aa group
group of
of characters,
characters, which
which ends
ends with
with aa
line-separating
line-separating character.
character.
•• A
A screen
screen is
is the
the display
display area
area for
for text.
text.
• Word
^a beginning, ^e end.
Slide 7-3
Move Directly to a Line
•• There
There are
are no
no line
line numbers
numbers in in emacs.
emacs. If
If you
you need
need to
to
• There are no line numbers in emacs. If you need to find out your location
(line number and column position) perform the request count_lines or
esc-=
• There are two ways to position to a line number, both ways use the
go_to_line request.
Slide 7-4
Repeating a Sequence
•• The
The esc
esc key
key is
is known
known as as the
the argument
argument parameter
parameter
• The esc key is known as the argument parameter key. All emacs requests
are commands issued by key sequences and the commands can take
arguments. An example of this is the goto line sequence.
esc line_number ^g
• emacsrepeats operations by using the esc key argument and typing in the
number of occurrences. In the system area of the screen you'll see the
word argument and the number of times.
Slide 7-5
Search for a String
•• AA search
search string
string isis the
the sequence
sequence of of characters
characters to to
•• Modify
Modify thethe search
search pattern
pattern is
is by
by doing
doing aa
yank_prompt esc-y..
yank_prompt esc-y
•• To
To perform
perform aa caseless
caseless search,
search, you
you need
need to
to set
set the
the
caseless
caseless mode
mode on on set_mode caseless_search on.
set_mode caseless_search on.
Slide 7-6
Global Search and Replace
•• To
To replace
replace each
each occurrence
occurrence of of aa string
string from
from the
the
–– The
The replace
replace command
command queries
queries you
you with
with aa list
list of
of 44
choices
choices
You can replace each occurrence of a string in the buffer with another string.
Slide 7-7
Altering Text
•• Overlay
Overlay
•• Changing
Changing to
to Upper/Lower
Upper/Lower Case
Case
–– Changing
Changing case
case to
to altering
altering text
text can
can be
be done
done in
in several
several
ways:
ways:
Overlay
You modify text in the text buffer by inserting or by overwriting the text.
• The insert mode (default mode) adds characters to the text. Insert text
by positioning the cursor on a line and typing the new characters.
• You can type over characters under the cursor in the overlay mode. This
mode is set by the command toggle_overlay_mode: esc- or esc-r.
To return to insert mode, issue the command again
Slide 7-8
Deleting and Copying Text
•• Marking
Marking Text
Text
•• Copying
Copying Text
Text
Marking Text
Deleting Text
Copying Text
Slide 7-9
Retrieving Text
•• Retrieve
Retrieve the
the text
text from
from the
the head
head of
of the
the kill
kill ring
ring
•• To
To yank
yank aa previous
previous item
item in
in the
the kill
kill ring.
ring.
•• To
To discard
discard what
what is
is at
at the
the head
head of
of the
the kill
kill buffer.
buffer.
•• You
You can
can merge
merge kills
kills together.
together.
Retrieving Text
The kill ring is set up for the retrieval of text. This buffer can not be viewed,
edited, or saved to a file. However you can cycle among the 10 items on the kill
ring.
• Retrieve the text from the head of the kill ring with the yank request, ^y.
• To yank a previous item in the kill ring, leave the cursor at the beginning
of the previous yank and use the wipe_and_yank_previous request
esc-^y.
• To discard what is at the head of the kill buffer so you can yank the next
item, use the request delete_last_kill, esc-^k
Slide 7-10
Formatting Text - Tabs
•• Tabs
Tabs
Formatting Text
Tabs
• The default tab positions are set every five spaces apart. [TAB] Move the
cursor along a line according to the default tab stop.
Relative Tabbing
• Relative tabbing allows the cursor to move quickly from one column to
another. \
• Before using, you have to set up the spacing for the first line of data.
(Relative tab positions are determined by the previous line spacing
between the characters).
• To enter the succeeding columns, press: esc-[TAB]
EMACS REQUESTS
ACTIVITY REQUEST
Move through the buffer forward esc-f
backward esc-b
beginning ^a
end ^e
Beginning of the screen esc-a
End of the screen esc-e
Next screen esc-n
Previous screen esc-p
This line to screen top ^L
Beginning of the file esc-<
End of the file esc->
Display line number esc-=
Go to line number esc line_number ^g
Repeat request esc number
Search for a string: forward ^s or esc-s
reverse ^r
Turn on caseless search esc-r
Request: set_mode casesless_search
on
Yank a prompt esc-y
Global search and replace esc-^r
Insert/Overlay text esc-_
Changing word case: UPPER esc-u
lower esc-L
Initial esc-c
1. In your directory there is a file named abbreviations. Invoke emacs with the
name of this file.
a. Use the arrow keys to move up, down, right and left in this file until you
feel comfortable. Remember [shift] arrow keys as well.
d. Move to the last line in the screen with the request__________ Move to
last line in file with the request __________________
e. Move to the top of the screen with the request _____________ Move to
the top of the file with the request _______________
f. Use the request to go to line 50 of the file. What does this line of text
say?___________________________________________________
There are two ways step f could have been done what are they?
b. Again, globally search this document and change every occurrence of the
word 'computer' to 'COMPUTER'.
Slide G-1
303 - VOS Fundamentals
Appendix G
Emacs
Emacs Timesaving
Timesaving Techniques
Techniques
Education
Stratus
Slide G-2
Objectives
Education
Stratus
Emacs Timesaving Techniques
This chapter covers some of the techniques that make emacs easier for you. This
section demonstrates how to combine basic techniques to create macros, bring
several files into one emacs session, and to issue system commands without
leaving your emacs session.
• Define macros.
• Read several files into an emacs session.
• Display files in several windows.
• Create new key requests.
• Execute system commands from emacs.
• Set emacs switches that are suitable for them.
Slide 8-2
Macros in emacs
•• Macro
Macro Description
Description
•• Implementing
Implementing macros
macros
•• Executing
Executing macros
macros
• Implementing macros
When you end the macro, the macro is stored in the macro buffer. Only
one macro can be in the (unnamed) macro buffer.
• Executing macros
Slide 8-3
Macros in emacs (continued)
•• Macro
Macro commands
commands
• Macro commands
- If you never save the macro buffer to a macro name, then that
macro is gone when you leave emacs
In emacs, when you save a file, it does not quit nor does it have a command that
will do a save and quit, so here is a perfect example of using a macro to combine
some keystrokes
8. Issue the command save_macro; when prompted, give it a name, for example:
write_quit
Slide 8-4
Macros
•• You
You execute
execute aa macro
macro by
by the
the execute
execute request
request ((esc
esc rr))
•• Mapping
Mapping requests
requests and
and macros
macros is
is done
done by
by the
the
command set_key .. However
command set_key However you
you need
need to
to know
know the
the
key
key sequence
sequence so
so you
you can
can map
map the
the request.
request.
esc-?
esc-t <-- type in the sequence
esc-t = undefined
esc-`
F1 <-- Press the function key
`01a
^x-^
^AA <-- Emacs interprets the data
Slide 8-5
Macros (continued)
•• Assigning
Assigning aa key
key has
has several
several rules.
rules.
• You can distinguish upper from lower case letters with the ` (accent
grave) character. Otherwise case doesn't matter.
esc-r
Request: set_key
Key name: ^A-A
Request name: write_quit
Slide 8-6
Defining Multiple Buffers
•• Create
Create Several
Several Buffers
Buffers for
for Existing
Existing Files
Files
letter2:
%educ#d102>Education>Al_Rizo>lette2
window1:
buffer list:
• You may use multiple buffers to edit several files during the same emacs
session.
• You can create several buffers by specifying the file names that you wish
to edit on the command line.
emacs letter1 letter2
• The operating system creates a buffer for each file and gives this the
same name as the file. There is one default buffer called window1. This
buffer is not used when a file name is given.
Slide 8-7
Create a New Buffer
•• Move
Move to
to an
an Existing
Existing Buffer
Buffer
•• Create
Create aa New
New Buffer
Buffer
• The buffer request will always toggle between the current buffer and the
previous buffer examined. If the buffer you want is not shown inside the
prompt then type in the buffer name.
Buffer name(letter2):
Slide 8-8
Changing Buffers
•• Read
Read aa File
File into
into the
the Text
Text Buffer
Buffer
•• Changing
Changing Buffers
Buffers and
and Read
Read aa File
File Automatically
Automatically
^x-^f
^x-^f
Filename: <---
Filename: <--- type
type existing
existing file
file name
name
Slide 8-9
Requests
•• Define
Define the
the search
search string
string using ^s or
using ^s or esc-s
esc-s
•• You
You can
can retrieve
retrieve text
text copied
copied or
or deleted
deleted to
to the
the kill
kill
ring
ring regardless
regardless of
of which
which buffer
buffer itit came
came from.
from.
–– Move
Move to
to any
any buffer
buffer and
and yank
yank the
the text
text from
from the
the ring.
ring.
You can perform any requests in a buffer then change buffers and repeat the
request in the other buffer. For example, search for the same string of characters
throughout different buffers.
Slide 8-10
Save Contents of Buffers
•• The
The cursor
cursor must
must be be in
in aa buffer
buffer toto save
save its
its contents.
contents.
With multiple buffers, you must move into each one and write its contents to a file.
If you attempt to exit without saving a modified buffer, then the system prompts
you.
N buffers are modified and not written. Quit anyway?
Note: The system does not say which buffer needs to be saved. and N is the
number of buffers that need to be written.
The list buffer displays (modified) for each modified buffer not yet written to disk.
Slide 8-11
Defining Multiple Windows
•• AA default
default window
window is is always
always present,
present, window1.
window1.
Describing Windows
Slide 8-12
(continued)
•• Create
Create Windows
Windows inside
inside emacs
emacs
• Emacs will determine the size of the window. All windows are created
of equal size. (^x-+ and ^x-- can be used to grow/shrink)
• The cursor is moved to the newly created window.
• The windows are called (window n), n is the window number.
• The windows are unassigned to a buffer. When inside a window issue
the request go_to_buffer, ^x-b, to assign a buffer.
Some requests automatically create a window and load a file into it, e.g.
read_error_file, ^x-^e and find_include_file , ^x-^i
Slide 8-13
(continued)
•• Using
Using aa Window
Window
Using a Window
^x-p prev_window
^x-n next window
As you move from window to window the system area will update to inform you
of the window location.
Delete a Window
Slide 8-14
Setting emacs Mode
•• To
To see
see the
the current
current mode
mode setting:
setting: show_modes
show_modes
There are several modes that can be set in emacs to select different emacs
interfaces. For example, you can select overlay instead of insert mode.
cr_insert: off
go_to_line_ask: off
overwrite_ask: off
Current EMACS buffer modes for 'buffer list'
overlay: off
uppercase: off
tab_size: 5
• Set emacs mode variables with the command set_mode. If omitted, emacs
will prompt you for the mode variable and setting.
esc-r
Request: set_mode overwrite_ask on
New setting: on
Emacs allows you to tailor its environment allowing you to redefine key sequences
or create function keys that execute macro scripts. However when you leave
emacs you lose that tailored environment. This is where start_up files can be
helpful.
Slide 8-15
Programmers Tools
•• read_error_file
read_error_file ^x-^e
^x-^e
Programmers Tools
read_error_file ^x-^e
Attempts to find a file with the same entry name as the current window and a
suffix of .error.
Splits and loads the .error file in the bottom window.
This can also be done from the command line by using:
emacs prog1.c prog1.error -num_windows 2
Using macros to create a keystroke sequence to locate the line numbers where
programming errors have occurred and then position your cursor in the source code
at the beginning of those lines is easy when you have an error window. Below are
the key sequence steps. The assumption is you have 2 windows. The source code
is in the top window, and errors are in the bottom window.
Note: The statements that use set_mode may not be needed if you use set_mode
go_to_line_ask on in your start_up file.
Slide 8-16
Programmers Tools (continued)
•• Finding
Finding Declarations
Declarations
Finding Declarations
If you are a PL/I, C or Pascal programmer using VOS s$ subroutines here is a way
to declare your routines:
Type in your routine name in and then issue the request declare_subroutine, ^z-d,
which will do the following:
• Reads the name of the routine near the cursor
• Searches in the Lang declaration buffer for the declaration
• Copies the found declaration into the current buffer.
Slide 8-17
Programmers Tools (continued)
•• Using
Using the
the request,
request, match_parens, ^x-^m or
match_parens, ^x-^m ^x-cr will
or ^x-cr will
•• For
For quotation
quotation marks
marks ('(' and
and ")
") only
only matches
matches in
in aa
forward
forward direction.
direction.
Using the request match_parens, ^x-^m or ^x-cr, will attempt to move your
cursor to the next corresponding character.
For quotation marks (' and ") only matches in a forward direction.
Someday you will be faced with losing your emacs session. This may be do to
user error, system failure, communication failure, or whatever. You'll need to
know how to playback your emacs keystroke file.
The following steps will show you how to playback keystroke file:
Before step 3 you may need to edit the keystroke file if the user had entered the
quit request and that is the reason for recovery.
Slide 8-18
VOS Tools
•• Clearing
Clearing messages
messages while
while in
in emacs
emacs
–– The
The terminal
terminal can
can bebe cleared
cleared of
of messages
messages (AKA
(AKA
redisplayed)
redisplayed) by
by the
the request
request redisplay,
redisplay, ^v
^v
VOS Tools
Slide 8-19
Executing Commands
•• To
To execute
execute aa command,
command, give
give the
the request, ^x-c..
request, ^x-c
Executing Commands
Executing Commands
Slide 8-20
(continued)
•• The
The execute_command
execute_command request
request and
and don't
don't wait
wait for
for
The execute_command request and don't wait for output has 4 arguments:
If you specify 4 emacs will not wait for the command to finish, but return back
to the buffer so you can continue editing.
If you specify 5 as an argument emacs will invoke a privileged process to
execute the command.
If you specify 6 as an argument emacs will invoke a non-privileged process,
and prompt for command and module name*
If you specify 7 as an argument emacs will invoke a privileged process, and
prompt for command and module name.
All results goto a buffer default_output.n , where n is the buffer number.
The request ^x-c, has 2 ways to pass arguments to the request
Using the execute_request command, esc-r
Request: execute_command 2
Using the argument parameter key esc-number
esc-2
^x-c
Slide 8-21
VOS Tools
•• Creating
Creating aa sub_process
sub_process
Creating a sub_process
You can create a sub_process by the request login_process, ^x-l, this is useful
when you need to invoke other Stratus utilities and don't want to leave emacs.
Emacs is suspend until logout is issued. This will return you back to the emacs
session.
EMACS REQUESTS
ACTIVITY REQUESTS
List all buffers ^x-^b
Create/switch buffers ^x-b
Read file into a buffer ^x-^r
Read a file into a new buffer ^x-^f
EMACS REQUESTS
ACTIVITY REQUESTS
Apply a keystroke file ^z-a
1. First, list the files in your directory to see if you have a file named
emacs_keystroke_macros Is it there?____________________
From:
3. Change to a new buffer called demo and issue the macro memo.
Two ways this macro could be issued:
4. Create a start_up.emacs file and place the request that will execute the macro
memo when you bring up emacs.
5. Change your start_up.emacs file so the key ^x-m will do a save_file and quit
out of emacs. Also remove the last entry from step 4
6. There are four sample files in your directory named: trout_almondine, rice,
asparagus, and tarts. Use the read_file request to combine them all into a new
file called dinner.
7. Invoke emacs with the file dinner. Append this buffer to the file memo_demo.
Change buffers and read the file memo_demo in to see what the file looks like.
8. Use the -num_windows option on the emacs command to load copies of the
files, addresses and names, into separate windows on your screen.
a. Use the kill and the yank requests to copy the respective addresses from
the address window into their proper location in the names window.
b. Once you are finished, save the modified buffer under the title of
addresses_names.
c. Quit the emacs session and print out a copy of the file, addresses_names,
to be sure you performed the steps correctly.
9. Create a macro that will go to the bottom window which will have the line
numbers of errors to the above window (which has a program).
Use the -num_windows argument of the emacs command to load the files,
bad.cobol and bad.error, into two separate windows on the screen. (Be sure
that bad.cobol is in the default buffer before you continue with the following
tasks.)
After the macro has been created quit out of emacs and test your macro from
scratch.
10. Invoke emacs with the name of a non-existing file called new.
b. Using the request to issue a command, issue the command list. The
request should wait for the output of the executing system command.
c. Copy the list of files into your previous buffer, to make step a true.
d. Once you have done this, position the cursor at the end of the buffer
(new) and type in the following statement: These are abbreviations
that I can use on the command line.
f. When you are ready, go to the buffer that contains the abbreviations.
Copy the abbreviations into your previous buffer, to make step f true.
11. Invoke emacs with keystrokes. Make some changes to the buffer (window1 if
your using the default) but quit without saving the changes. Replay your
keystrokes to make the changes and save the buffer to a file.