VSH(1) UNIX Programmer's Manual VSH(1) NAME Vsh - visual shell SYNOPSIS Vsh DESCRIPTION _V_s_h is a highly interactive, visually oriented shell which eases many programming activities. Most commands involve only a single keypress. These commands cause directories to be displayed, editors to be entered, and compilers to be invoked. On entry to _v_s_h, the current directory is plotted on the screen. Each member of the directory is labeled with a letter. To select a member, one presses its corresponding letter. What happens after selection depends on the nature of the member. If the member is a directory, _V_s_h changes to that directory. Text files are edited. Full details are given later in this manual. _V_s_h displays up to twenty files at a time. Directories which are larger are broken into twenty-file pages. There can be ten pages holding a total of two-hundred members. To select a page, one presses a digit 0-9. Pages are numbered one through ten with 0 selecting page ten. A well integrated feature of _v_s_h is its connection between compilers and editors. To start a compile, one presses M. _V_s_h then calls on _m_a_k_e(1). The output of this compile step is saved, and one can later review for compile-time errors. _V_s_h numbers each error. One can select an error by typing in its number. After selection, _v_s_h calls an editor, send- ing one to the proper file at the offending line. One can jump between the editor and _v_s_h until one is ready for another compile. Because _V_s_h is unconventional, the best way to understand how it works is by using it. Because _V_s_h is menu driven, it is hard to get lost. Beginners should find _V_s_h easier to learn then the conventional shell. ENVIRONMENT PARAMETERS _V_s_h takes the following parameters from the global environ- ment: HOME The home directory. This parameter is automaticly set by _U_n_i_x when one logs in. SHELL The users login shell. _U_n_i_x also sets this parameter. When it is necessary to escape to a shell, this parameter selects Printed 8/2/83 1 VSH(1) UNIX Programmer's Manual VSH(1) the program to use. TERM The terminal type. The terminal must be cursor addressable. The user must set the TERM parameter himself. As an exam- ple, to indicate your terminal is an adm3a, from _c_s_h(1) type: % setenv TERM adm3a From _s_h(1) type: $ TERM=adm3a; export TERM See _t_e_r_m_c_a_p(5) for more information about the TERM parame- ter. FILE SELECTION As indicated before, one selects a file by pressing its corresponding letter. What happens after selection depends on the nature of the file. File type Action Directory Change to new directory. Archive Print archive directory. This works for both _a_r(1) and _c_p_i_o(1) format archives. Object program Print name list (external symbols). Core Call debugger. Text Call editor. Other Selection fails. DIRECTORY OPERATIONS This is a list of the directory commands. Before doing any- thing else, the user should become familiar with commands which allow him to select files and display directories. In directories larger then twenty files, the user should be able to display each page. Printed 8/2/83 2 VSH(1) UNIX Programmer's Manual VSH(1) Command Action ^D Leave _v_s_h. a-t Select corresponding file. 1-9 Select page 1-9. 0 Select page 10. + Select next page. ; Same as +. - Select previous page. ^ (Home) Change to home directory. / Change to root directory. ? Display help file. ! Escape to shell. % Same as !. $ Escape to Bourne shell. -Line Feed- Change to previous (parent) directory. These are convenience commands. D Display date. I DIsplay file. _V_s_h prompts for a file and displays it as ascii text. This is faster than a selection which calls the editor. P Process status. Call /bin/ps. W Who. Display who is logged in. Y Yank. Display free ports. These are advanced commands. F Select file by name. _V_s_h prompts for a file name. _V_s_h then selects the specified file. C Create a new file. _V_s_h prompts for a file Printed 8/2/83 3 VSH(1) UNIX Programmer's Manual VSH(1) name and file type. One may create text files and directories. One may also copy and link from existing files. L Long format file listing. Next to each file, _V_s_h displays protection information in the same manner as _l_s(1). O Option listing. The contents of command and parameter tables are displayed. _V_s_h then prompts for commands which modify parameters and which create, modify, and delete commands. REMOVE MODE Press R to enter _R_e_m_o_v_e _m_o_d_e. In _R_e_m_o_v_e _m_o_d_e, selecting a file causes it to be marked for removal with two slashes, "//." Files selected a second time are unmarked. Pressing R a second time causes all marked files to be removed. The following commands are available in _R_e_m_o_v_e _m_o_d_e: Command Action -Return- Exit _R_e_m_o_v_e _m_o_d_e with out removing marked files. ^D Same as -Return- a-t Select corresponding file for removal. * Select all files on current page for remo- val. 0-9, +, - Select and display another page. These commands are described earlier in the manual in the section on directory opera- tions. ? Display help file. R Remove marked files and exit _R_e_m_o_v_e _m_o_d_e. If _V_s_h cannot remove a file, _V_s_h displays the reason and waits for a response. Press -Return- to continue removing marked files. Press ^D to immediately exit from _R_e_m_o_v_e _m_o_d_e. MAKE, GREP, AND SHOWFILE _V_s_h interfaces to _m_a_k_e(1) and _g_r_e_p(1). _V_s_h saves output from these programs and allows one to examine the results in _s_h_o_w_f_i_l_e _m_o_d_e. From the directory page, the following Printed 8/2/83 4 VSH(1) UNIX Programmer's Manual VSH(1) commands control _m_a_k_e, _g_r_e_p, and _s_h_o_w_f_i_l_e. G _g_r_e_p(1). _V_s_h prompts for a pattern and file names, and then run _g_r_e_p with these parameters. The results are saved in the file ._g_r_e_p_o_u_t and displayed in _s_h_o_w_f_i_l_e _m_o_d_e. S Show previous _g_r_e_p. The output of the last _g_r_e_p is displayed in _s_h_o_w_f_i_l_e _m_o_d_e. M _M_a_k_e(1) _V_s_h runs _m_a_k_e. Execution is con- trolled by the _m_a_k_e_f_i_l_e in the current directory. Output is both displayed on the screen and saved in the file ._m_a_k_e_r_- _r_o_r. When _m_a_k_e terminates, _V_s_h displays ._m_a_k_e_r_r_o_r in _s_h_o_w_f_i_l_e _m_o_d_e. N _m_a_k_e(1) running independently. _M_a_k_e is run but _V_s_h does not wait for termination. Output is saved in ._m_a_k_e_r_r_o_r, but is not displayed on the screen. When _m_a_k_e ter- minates, the bell on your terminal rings twice. Use the E command to review the output in ._m_a_k_e_r_r_o_r. E Review errors. The results of the last _m_a_k_e are displayed in _s_h_o_w_f_i_l_e _m_o_d_e. SHOWFILE MODE _S_h_o_w_f_i_l_e displays the results of a _m_a_k_e or _g_r_e_p. It is called by the E and S commands. _S_h_o_w_f_i_l_e is called automat- ically in the course of an M or G command. _S_h_o_w_f_i_l_e is essentially a special editor. It has commands which allow one to display a file. One can also command _s_h_o_w_f_i_l_e to examine a line of the file. _S_h_o_w_f_i_l_e scans this line and attempt to extract a file name and line number. _S_h_o_w_f_i_l_e then runs the editor, starting it at the specified line. These are the _s_h_o_w_f_i_l_e commands. It is not necessary to press -Return- after these commands. When a complete com- mand is sensed, it is run immediately. Command Action number p Print file starting at specified line. number e Examine line for a file name and line number. If a file name is found, run the editor on this file. Printed 8/2/83 5 VSH(1) UNIX Programmer's Manual VSH(1) -Return- Display next twelve lines. number -Return- Same as number e ^D Leave _s_h_o_w_f_i_l_e. q Leave _s_h_o_w_f_i_l_e. ? Display help file. All commands from the directory page which might be useful are available in _s_h_o_w_f_i_l_e _m_o_d_e. They include ^, /, !, %, and A through Z except L and R. Particularly useful are M and G which allow new iterations of _m_a_k_e and _g_r_e_p, %, the escape to the shell, and F, which allows one to edit files not found in the file being shown. CONTROL COMMANDS The operation of _V_s_h is controled by its parameter and com- mand tables. The contents of these tables can be displayed via the O command. These tables can be modified with con- trol commands. When _V_s_h is invoked, it searches for the file ._v_s_h_r_c in your home directory. Control comands are then read from this file, allowing one to create a personal- ized environment. The O command also prompts for control commands, allowing for interactive modification of the tables. These control commands should be presented in the same lexi- cal grammer as shell commands. Spaces and tabs separate tokens. Unquoted newlines terminate each statement. A character may be quoted by preceding it with a \. All char- acters inside single quotes (' ') are quoted except the sin- gle quote. Inside double quotes (" "), \ quotes another double quote and \newline is ignored. Grave accents (` `) are treated as any other character. Macros (such as $HOME) are not available yet. The lexical grammer is compatible with that of _s_h(1). The grammer is somewhat different from that of _c_s_h(1). One's ._v_s_h_r_c file is essentially appended to the end of _d_f_l_t._v_s_h_r_c. Printed 8/2/83 6 VSH(1) UNIX Programmer's Manual VSH(1) To change a parameter, use the format: PARAMETER-NAME PARAMETER-VALUE PARAMETER-NAME can be any off the following: Parameter Usage editor Preferred editor. Default is /_u_s_r/_u_c_b/_v_i. nm Namelist program. Default is /_b_i_n/_n_m. db Debugging program. Default is /_b_i_n/_a_d_b. make Make program. Default is /_b_i_n/_m_a_k_e. grep grep program. Default is /_b_i_n/_g_r_e_p. ar Archiving program. Default is /_b_i_n/_a_r. To define a command, use the format: CHARACTER KEYWORD [PARAMETERS ...] CHARACTER is the character which calls the new command. Valid characters are ! " # $ % & ' ( ) : * = ^ ~ [ ] { } < > , . / ? and A-Z. These are the valid keywords: Keyword Purpose date Display date. showerror Show errors from previous _m_a_k_e. showgrep Show output from previous _g_r_e_p. file Select a file. If parameter is present, the parameter is selected. Otherwise, _V_s_h will prompt for a file name. home Change to home directory. grep Run _g_r_e_p. _V_s_h will prompt for parameters. wmake Run _m_a_k_e. Wait for termination. Printed 8/2/83 7 VSH(1) UNIX Programmer's Manual VSH(1) fmake Run _m_a_k_e. Do not wait for termination. remove Enter _R_e_m_o_v_e _m_o_d_e. longlist Print long format listing of files on the current page. display Display the contents of a file. If no parameter is present, _V_s_h will prompt for a file name. options Display _V_s_h options (parameter and command tables). Accept commands which modify parameters and which create, modify, and delete commands. exec Execute a program directly with the exec system call. The first parameter must be the program name. Directories are not successively searched as in the shell. Full path names are necessary. Any other parameters become parameters to the pro- gram. If it is necessary to search several directories for programs, to redirect files, to expand macros, or to expand file regular expressions, use the shell keyword instead. shell If no parameter is present, an interactive shell is spawned. If one parameter is present, it is passed to the shell and run as a command. Do not specify more than one parameter. Instead, enclose the entire shell command in quotes to provide _V_s_h with only one parameter. create _V_s_h prompts for a new file name. The file is created. null Delete command. The command will no longer be active. FILES $HOME/.vshrc initialization file. /etc/termcap terminal capability database necessary for addressing cursor. .makerror File used to save the output of _m_a_k_e. .grepout File used to save the output of _g_r_e_p. _V_s_h tries to first create this file in the working direc- tory. If unsuccessful, the home directory is tried. $SHELL user's shell /bin/pwd Program which determines the path name Printed 8/2/83 8 VSH(1) UNIX Programmer's Manual VSH(1) of the working directory. /dev/null data sink Printed 8/2/83 9