HP-UX Reference (11i v3 07/02) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
introduction(9) introduction(9)
The eof, erase, and kill
characters can be used as normal text characters if you escape them with a
preceding
\,asin\ˆD. Therefore, to erase a
\, you need two erases.
The
intr, quit, start, and
stop characters cannot be escaped on the input line.
End-of-Line and Tab Characters
Besides adapting to the speed of the terminal, HP-UX tries to be intelligent as to whether you have a termi-
nal with a newline (line-feed) key, or whether it must be simulated with a return/line-feed character pair.
In the latter case, all incoming return characters are changed to line-feed characters (the standard line del-
imiter), and a return/line-feed pair is echoed to the terminal. If you get into the wrong mode, use the
stty command to correct it (see stty(1)).
Tab characters are used freely in HP-UX source programs. If your terminal does not have the tab function,
you can arrange to have tab characters changed into spaces during output, and echoed as spaces during
input. The
stty command sets or resets this mode. By default, the system assumes that tabs are set
every eight character positions. The tabs command (see tabs(1)) can set tab stops on your terminal, if the
terminal supports tabs.
How to Run a Program
When you have successfully logged into HP-UX, the shell monitors input from your terminal. The shell
accepts typed lines from the terminal, splits them into command names and arguments, then executes the
command. The command can be the name of a shell built-in, an executable script of commands, or an exe-
cutable program. There is nothing special about system-provided commands, except that they are kept in
directories where the shell can find them. You can also keep commands in your own directories and
arrange for the shell to find them there.
The command name is the first word on an input line to the shell; the command and its arguments are
separated from one another by blanks (one or more space and/or tab characters).
When a program terminates, the shell ordinarily regains control and prompts you to indicate that it is
ready for another command. The shell has many other capabilities, which are described in detail in the
appropriate manpages: sh-posix(1) for the POSIX shell, ksh(1) for the Korn shell, or csh(1) for the C shell.
The Current Directory
HP-UX has a file system arranged in a hierarchy of directories. When the system administrator gave you a
user name, he or she also created a directory for you (ordinarily with the same name as your user name,
and known as your login or home directory). When you log in, that directory becomes your current or work-
ing directory, and any file name you type is assumed to be in that directory by default. Because you are the
owner of this directory, you have full permission to read, write, alter, or destroy its contents. The permis-
sions you have for other directories and files will have been granted or denied to you by their respective
owners, or by the system administrator. To change the current working directory use the
cd command
(see cd(1)).
Path Names
To refer to files not in the current directory, you must use a path name. Full (absolute) path names begin
with
/, which is the name of the root directory of the whole file system. After the slash comes the name of
each directory containing the next subdirectory (followed by a /), until finally the file name is reached (for
example, /usr/ae/filex refers to file filex in directory ae, while ae is itself a subdirectory of usr;
usr is a subdirectory of the root directory). See glossary(9) for a formal definition of path name.
If your current directory contains subdirectories, the path names of files in them begin with the name of
the corresponding subdirectory (without a prefixed /). Generally, a path name can be used anywhere a file
name is required.
Important commands that modify the contents of directories are cp, mv, and rm which respectively copy,
move (that is, rename, relocate, or both), and remove files. To determine the status of files or the contents
of directories, use the ls command. Use mkdir to make directories, rmdir to destroy them, and mv to
rename them. See cp(1), ls(1), mkdir(1), mv(1), rm(1), and rmdir(1).
Writing a Program
To enter the text of a source program into an HP-UX file, use a text editing program such as vi, ex,ored
(see vi(1), ex(1), and ed(1)). The three principal languages available under HP-UX are C (see cc_bundled(1)
and cc(1)), FORTRAN (see f77(1)), and aC++ (see aCC(1)). After the program text has been entered with
the editor and written into a file (whose name has the appropriate suffix), you can give the name of that file
to the appropriate language processor as an argument. Normally, the output of the language processor will
HP-UX 11i Version 3: February 2007 − 6 − Hewlett-Packard Company 277