Images/ 40755 1032 165141 0 6113364524 11466 5ustar laufersnobodyImages/search.gif100755 1032 165141 1011 6113364523 13512 0ustar laufersnobodyGIF89a@@!,@@ڛ@{Åi6vKJ<޳ Q w6f*s*RW[Flr@pŪZUS^aw2&xC!xIf 6'FCJz w;ƊZhhi%;+[jȻ;,;k- + ]]k~]M-J\v\:~Ёag-JA^C*BݱPq#L^!#r$IV,;2FNJ)gQ1isϟL,N{d(FAd!ꤩ0>5kRw8jibTk%Xv.E`X*}4ֻx hoF'! \!E)85eɽ4jK'l'qr<%\z;d_$s˓7rkw,7BGn™^;;Images/index.gif100755 1032 165141 607 6113364523 13346 0ustar laufersnobodyGIF89a@@!,@@ڋ޼bf0Fz +, .̴Z.iI&wvHkzl7(u utlZ^>}EcHFHG奸68ItfX!XI5fyqT;j:׊Ky*[f:($50P|IWhTlh&R<6M+ n-q=t^m}?>~7PAb#&СDyM0YfDÏ #4㸳i NU֭\z 6رd˚={;Images/unicrest.gif100755 1032 165141 7752 6113364524 14124 0ustar laufersnobodyGIF87awwZXM||vddd3." %x%*ID5 p9Q,F*=6@9 &< = <=rcAg /B#6Ϻت,ww@pH,Ȥrl:ШtJZج6zxL Pna#|>Â-tmrafb ^ksj`_ ] _ vno|`a~ee~  ca xc̃E]]valx wΑ]gk01{'(ח 4GXԷ`Bp>fJ9%dƒ7tlqG%]=ͭks`?QY3'*9@)ү`ۨ'O.r`5W <ABNx@!X cP?CJA![|a#KD TPP@װ#}d}ʖMלҪ,Z㳓62 H]oW.#\\WN3H$LkmZa Tp vWn%tƖCcUa$GH)H{R%Qj߈%hA&$?a-IhyAwmSgs4t/E?2zaeeke'9Y(d%qrqe衇hc<efE&idlBcB9qؖ}1uaꪬz fvsu뮼k_y8o02@0*9(*ZNTp orS4 WcG5oua4˫-;͒%c.&pUfR/_ܘ_ 0Jl+ ld\;.{l"\H08`..vAЗcxԅZy,1Xp(@0|Etkv v/-~ы\k xG߲0<TO򏤢FmDJY{-Z"-`8Ps|v65qNSRHT0@X4yK[: KF~Ƭ0]D0%BHAK~#j? /T"CbVtgsڴECꨢӢ8BMMudd{Gmeb8 jhD,7G We*Fem(U6P.#Zv@ )>|Ls-@1a Bl t^}( hLJ,ci%6/R %ѕrň$#A) +(>Lv` vMMzo 0iq:T'ObTkd)`Rҭk^ךـ82S\&LXr@b-yGU=!wjAHA3 @C:p ۈ:B0 0?Q9ۨ4Ko}Rt!m.& }@93:tvIFòr:FJd[R"< 4"U*l)Ҹ*8H/dR´TR0s jE{m)~ :p5\⤷")ٙĬ]<5H@o5 &Dt XgF{!52P.]4+8OUjeAf WxcYs'%aPBu @]S`@.jۗ4Rl^8 ų#ْ mԸUMj{Oږ{3 Z bv7@]VRp@ Xlqm,U83mZjyͭH7Xo-t,8 VO|5 .T; 4Wd1 `Ġ7 eo6k \p&RwIC@Plm`ń- =t :*(%[a Mo50RM*8})dvgtP o"2ӺnشHXw,ɞrmqߺ J@k@g2WNTK[f3kzmG  hpW"5e,:˃o2# Kj&9^sUEM [#q4CݫfʔMЄ5/ؤ5E.n/ J* 78 BfhR|0'\IMN#JK&h~hxz_{<$iXKѕɋ!љDךu{8S$aܼ;NzׁS#S莔 {4Gt<l@/!1!;|P cGC5Q?w7-¤Za!+3"t>%v~4Kss!F&JMr-v88}R_hxGu wKUE(9g hOwj?a Gap-fx{H]R]+6w" PXI!OxL|}Xb!_1K476SWr`']62d'Eps,p C <<<<xb$ @E`=†]t{PôNxC!‚$S-$=0lVzm01%`Eqb!HOEuA(w212v` snhT|_pG"$p@KK_t{9M"yx'0xr;)<\*@"AB\y?H}8Cf#E!5%wa\0uV'1 0y-;`3x)(d$.J)_@c`V6'/H-kDFX<ɰ5mLpO.Sp.sx$ )~(@Y,hC rDW5H J7?c7i`q,oQ|VYbADdY+ؚ!+V+0U)^8CbO_Obis̀<_,@7Uy-CBgu`ǝ"P%iO6!2`+:ӀG+Щ*s<| Ѕ!)x#pI3,(1 <o1)Sur| 1)q\ 3aF0zх1qҍHk$w..!z`EBҏIZ% +Gtbݘ$}Dd!W2S &pҤcu5g#}n9Jw҅ &&ɢo(hso!V6.p1zj$D@IX?9-jUI8e`?]x:4&%AZ ]: P)0aaJ9P!za* % P!%$x d pØsP*`" (upPmǰ r3y *а3[ɀ [(>?: ( j*_z&{  AA{. ^d[f{hjl۶E;Images/top.gif100755 1032 165141 657 6113364524 13047 0ustar laufersnobodyGIF89a@@*!,@@ߖs f޸HZK-Kh~>#*k?p e6<+WVe!tT3Y'q6UAtR4,¼ߣu##V¡!yMAP1XQx3iuyY;Images/weeindex.gif100755 1032 165141 265 6113364524 14050 0ustar laufersnobodyGIF87a \, lym(pT_I~c%Ý*HݭI')G.ckrBJU"&It~׋ 4s-|gw(xHwGX踸YGahyY)8az Q;VMStoUNIX.html100644 1032 165141 10414 6113364524 13000 0ustar laufersnobody VMS to UNIX Translation

VMS to UNIX Translation

To ...                      VMS                     UNIX

display list of files DIRECTORY ls DIRECTORY/FULL ls -l display contents of file TYPE cat display file with pauses TYPE/PAGE more, less display first few lines of file head display last few lines of file tail copy file COPY cp find string in file SEARCH grep fgrep compare files DIFF diff cmp rename file RENAME mv delete file or directory DELETE rm rmdir change file protection SET FILE/PROT chmod change file ownership SET FILE/OWNER chown chgrp create directory CREATE/DIR mkdir change working directory SET DEFAULT cd display working directory SHOW DEFAULT pwd get help HELP man apropos display date and time SHOW TIME date display free disk space SHOW DEV df stop process STOP kill link program modules LINK ld print file PRINT lpr display print queue SHOW QUEUE lpq display print entries SHOW ENTRY lpq change password SET PASSWORD passwd display logged-in users SHOW USERS who finger w display processes SHOW PROCESS ps change terminal settings SET TERMINAL stty talk to another user PHONE talk disable messages SET NOBROADCAST mesg n

Thanks to Dave Atkin at the University of York for permission to adapt his VMS/Unix translation.


[Home] [Search] [Index]
about_menu1.html100644 1032 165141 2664 6113364525 13474 0ustar laufersnobody About the Tasks menu

About the Tasks menu

This menu contains items about tasks that you may want to carry out at some time as you use a UNIX system. It gives you straightforward information about how to do things such as:

If you are new to using UNIX you will also find it useful to look at the items in the Concepts menu.


[Home] [Search] [Index]
about_menu2.html100644 1032 165141 2414 6113364525 13466 0ustar laufersnobody About the Commands menu

About the Commands menu

This menu contains items that enable you to find and use UNIX commands. It gives you clear information about what commands there are and what they do. It covers:

If you have experience of using another operating system such as VMS or DOS you could start using UNIX right away with the information provided by this menu.


[Home] [Search] [Index]
about_menu3.html100644 1032 165141 2460 6113364525 13470 0ustar laufersnobody About the Concepts menu

About the Concepts menu

This menu contains items that illustrate and explain some of the basic concepts that are represented by any operating system and by UNIX in particular. It helps you to understand why UNIX behaves in the way that it does. It explains:

Understanding these concepts you will help you make better use of UNIX and have a clearer idea about what it is you are doing.


[Home] [Search] [Index]
about_menu4.html100644 1032 165141 2446 6113364525 13475 0ustar laufersnobody About the Utilities menu

About the Utilities menu

This menu gives you quick access to information about some of the general purpose utilities that are provided as standard by UNIX.

Knowing about a utility, what it does and how it can be combined with other utilities enables you to construct your own utilities for a specific task. It introduces you to utilities for:

If you need to manipulate information held in files you should look at the items in this menu.


[Home] [Search] [Index]
acknowledge.html100644 1032 165141 2712 6113364525 13532 0ustar laufersnobody Acknowledgements

Acknowledgements

The UNIXhelp project team would like to thank the following people who have contributed significantly to the current release:


[Home] [Search] [Index]
alphabetical/ 40755 1032 165141 0 6113364533 12672 5ustar laufersnobodyalphabetical/ma.html100644 1032 165141 4133 6113364525 14254 0ustar laufersnobody Index of manual pages: A

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

A

  • addbib - create or extend a bibliographic database
  • apropos - locate commands by keyword lookup
  • ar - create library archives, and add or extract files
  • at, batch - execute a command or script at a specified time
  • awk - pattern scanning and processing language

[Home] [Search] [Index]
alphabetical/mb.html100644 1032 165141 3774 6113364526 14270 0ustar laufersnobody Index of manual pages: B

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

B

  • banner - display a string in large letters
  • basename - display portions of pathnames and filenames
  • biff - give notice of incoming mail messages
  • bin-mail, binmail - an early program for processing mail messages

[Home] [Search] [Index]
alphabetical/mc.html100644 1032 165141 7260 6113364526 14263 0ustar laufersnobody Index of manual pages: C

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

C

  • cal - display a calendar
  • calendar - a simple reminder service
  • cat - concatenate and display
  • cb - a simple C program beautifier
  • cc - C compiler
  • cd - change working directory
  • checknr - check nroff and troff input files; report possible errors
  • chgrp - change the group ownership of a file
  • chmod - change the permissions mode of a file
  • clear - clear the terminal screen
  • cmp - perform a byte-by-byte comparison of two files
  • colcrt - filter nroff output for a terminal lacking overstrike capability
  • comm - display lines in common, and lines not in common, between two sorted lists
  • compress, uncompress, zcat - compress or expand files, display expanded contents
  • cp - copy files
  • cpio - copy file archives in and out
  • cpp - the C language preprocessor
  • csh - a shell (command interpreter) with a C-like syntax and advanced interactive features
  • ctags - create a tags file for use with ex and vi

[Home] [Search] [Index]
alphabetical/md.html100644 1032 165141 4204 6113364526 14257 0ustar laufersnobody Index of manual pages: D

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

D

  • date - display or set the date
  • dbx - source-level debugger
  • deroff - remove nroff, troff, tbl and eqn constructs
  • df - report free disk space on file systems
  • diff - display line-by-line differences between pairs of text files
  • du - display the number of disk blocks used per directory or file

[Home] [Search] [Index]
alphabetical/me.html100644 1032 165141 5156 6113364526 14267 0ustar laufersnobody Index of manual pages: E

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

E

  • echo - echo arguments to the standard output
  • ed, red - basic line editor
  • eqn, neqn, checkeq - typeset mathematics
  • error - categorize compiler error messages, insert at responsible source file lines
  • ex, edit, e - line editor
  • expand, unexpand - expand TAB characters to SPACE characters, and vice versa
  • expr - evaluate arguments as a logical, arithmetic, or string expression

[Home] [Search] [Index]
alphabetical/mf.html100644 1032 165141 4326 6113364526 14266 0ustar laufersnobody Index of manual pages: F

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

F

  • file - determine the type of a file by examining its contents
  • find - find files by name, or by other characteristics
  • finger - display information about users
  • fmt, fmt_mail - simple text and mail-message formatters
  • fold - fold long lines for display on an output device of a given width
  • ftp - file transfer program

[Home] [Search] [Index]
alphabetical/mg.html100644 1032 165141 3637 6113364527 14274 0ustar laufersnobody Index of manual pages: G

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

G

  • gcore - get core images of running processes
  • gprof - display call-graph profile data
  • grep - search a file for a string or regular expression
  • groups - display a user's group memberships

[Home] [Search] [Index]
alphabetical/mh.html100644 1032 165141 3270 6113364527 14266 0ustar laufersnobody Index of manual pages: H

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

H

  • history - re-use previous command lines
  • hostname - show name of current host system

[Home] [Search] [Index]
alphabetical/mi.html100644 1032 165141 3445 6113364527 14273 0ustar laufersnobody Index of manual pages: I

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

I

  • imake - C preprocessor interface to the make utility
  • indent - indent and format a C program source file
  • install - install files

[Home] [Search] [Index]
alphabetical/mj.html100644 1032 165141 3076 6113364527 14274 0ustar laufersnobody Index of manual pages: J

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

J

  • join - relational database operator

[Home] [Search] [Index]
alphabetical/mk.html100644 1032 165141 3124 6113364527 14267 0ustar laufersnobody Index of manual pages: K

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

K

  • kill - send a signal to a process, or terminate a process

[Home] [Search] [Index]
alphabetical/ml.html100644 1032 165141 6425 6113364530 14271 0ustar laufersnobody Index of manual pages: L

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

L

  • last - indicate last logins by user or terminal
  • ld, ld.so - link editor, dynamic link editor
  • leave - remind you when you have to leave
  • less - opposite of more
  • lex - lexical analysis program generator
  • lint - a C program verifier
  • ln - make hard or symbolic links to files
  • login - log in to the system
  • look - find words in the system dictionary or lines in a sorted list
  • lookbib - find references in a bibliographic database
  • lorder - find an ordering relation for an object library
  • lp, cancel - send/cancel requests to a printer
  • lpq - display the queue of printer jobs
  • lpr - send a job to the printer
  • lprm - remove jobs from the printer queue
  • ls - list the contents of a directory

[Home] [Search] [Index]
alphabetical/mm.html100644 1032 165141 4735 6113364530 14274 0ustar laufersnobody Index of manual pages: M

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

M

  • mail, Mail - read or send mail messages
  • make - maintain, update, and regenerate related programs and files
  • man - display reference manual pages; find reference pages by keyword
  • mesg - permit or deny messages on the terminal
  • mkdir - make a directory
  • mkstr - create an error message file by massaging C source files
  • more, page - browse or page through a text file
  • mv - move or rename files

[Home] [Search] [Index]
alphabetical/mn.html100644 1032 165141 3606 6113364530 14271 0ustar laufersnobody Index of manual pages: N

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

N

  • nawk - pattern scanning and processing language
  • nice - run a command at low priority
  • nm - print symbol name list
  • nroff - format documents for display or line-printer

[Home] [Search] [Index]
alphabetical/mo.html100644 1032 165141 3112 6113364531 14263 0ustar laufersnobody Index of manual pages: O

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

O

  • od - octal, decimal, hexadecimal, and ascii dump

[Home] [Search] [Index]
alphabetical/mp.html100644 1032 165141 5017 6113364531 14272 0ustar laufersnobody Index of manual pages: P

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

P

  • passwd, chfn, chsh - change local or NIS password information
  • paste - join corresponding lines of several files, or subsequent lines of one file
  • pr - prepare file(s) for printing, perhaps in multiple columns
  • printenv - display environment variables currently set
  • prof - display profile data
  • ps - display the status of current processes
  • ptx - generate a permuted index
  • pwd - display the pathname of the current working directory

[Home] [Search] [Index]
alphabetical/mq.html100644 1032 165141 3062 6113364531 14271 0ustar laufersnobody Q

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

Q

  • quota - display a user's disk quota and usage

[Home] [Search] [Index]
alphabetical/mr.html100644 1032 165141 5735 6113364532 14304 0ustar laufersnobody Index of manual pages: R

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

R

  • ranlib - convert archives to random libraries
  • rcp - remote file copy
  • rcs - change RCS file attributes
  • rcsdiff - compare RCS revisions
  • rev - reverse the order of characters in each line
  • rlogin - remote login
  • rm, rmdir - remove (unlink) files or directories
  • roffbib - format and print a bibliographic database
  • rsh - remote shell
  • rup - show host status of local machines (RPC version)
  • ruptime - show host status of local machines
  • rusers - who's logged in on local machines (RPC version)
  • rwall - write to all users over a network
  • rwho - who's logged in on local machines

[Home] [Search] [Index]
alphabetical/ms.html100644 1032 165141 13257 6113364532 14323 0ustar laufersnobody Index of manual pages: S

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

S

  • sccs - front end for the Source Code Control System (SCCS)
  • sccs-admin, admin - create and administer SCCS history files
  • sccs-cdc, cdc - change the delta commentary of an SCCS delta
  • sccs-comb, comb - combine SCCS deltas
  • sccs-delta, delta - make a delta to an SCCS file
  • sccs-get, get - retrieve a version of an SCCS file
  • sccs-help, help - ask for help regarding SCCS error or warning messages
  • sccs-prs, prs - display selected portions of an SCCS history
  • sccs-prt, prt - display delta table information from an SCCS file
  • sccs-rmdel, rmdel - remove a delta from an SCCS file
  • sccs-sact, sact - show editing activity status of an SCCS file
  • sccs-sccsdiff, sccsdiff - compare two versions of an SCCS file
  • sccs-unget, unget - undo a previous get of an SCCS file
  • sccs-val, val - validate an SCCS file
  • script - make typescript of a terminal session
  • sed - stream editor
  • sh - shell, the standard UNIX system command interpreter and command-level language
  • size - display the size of an object file
  • sleep - suspend execution for a specified interval
  • sort - sort and collate lines
  • sortbib - sort a bibliographic database
  • spell, hashmake, spellin, hashcheck - report spelling errors
  • split - split a file into pieces
  • strings - find printable strings in an object file or binary
  • strip - remove symbols and relocation bits from an object file
  • stty - set or alter the options for a terminal
  • su - super-user, temporarily switch to a new user ID
  • symorder - rearrange a list of symbols

[Home] [Search] [Index]
alphabetical/mt.html100644 1032 165141 6124 6113364532 14277 0ustar laufersnobody Index of manual pages: T

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

T

  • tabs - set tab stops on a terminal
  • tail - display the last part of a file
  • talk - talk to another user
  • tar - create tape archives, and add or extract files
  • tbl - format tables for nroff or troff
  • tee - replicate the standard output
  • telnet - user interface to a remote system using the TELNET protocol
  • test - return true or false according to conditional expression
  • tftp - trivial file transfer program
  • time - time a command
  • touch - update the access and modification times of a file
  • troff - typeset or format documents
  • true, false - provide truth values
  • tsort - topological sort
  • tty - display the name of the terminal

[Home] [Search] [Index]
alphabetical/mu.html100644 1032 165141 5527 6113364532 14306 0ustar laufersnobody Index of manual pages: U

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

U

  • ue - Full Screen Text Editor Version 3.9e
  • ul - do underlining
  • unifdef - resolve and remove ifdef'ed lines from cpp input
  • uniq - remove or report adjacent duplicate lines
  • units - conversion program
  • uptime - show how long the system has been up
  • users - display a compact list of users logged in
  • uucp, uulog, uuname - system to system copy
  • uuencode, uudecode - encode a binary file, or decode its ASCII representation
  • uusend - send a file to a remote host
  • uux - remote system command execution

[Home] [Search] [Index]
alphabetical/mv.html100644 1032 165141 4056 6113364533 14304 0ustar laufersnobody Index of manual pages: V

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

V


[Home] [Search] [Index]
alphabetical/mw.html100644 1032 165141 5302 6113364533 14300 0ustar laufersnobody Index of manual pages: W

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

W

  • w - who is logged in, and what are they doing
  • wait - wait for a process to finish
  • wall - write to all users logged in
  • wc - display a count of lines, words and characters
  • what - extract SCCS version information from a file
  • whatis - display a one-line summary about a keyword
  • whereis - locate the binary, source, and manual page files for a command
  • which - locate a command; display its pathname or alias
  • who - who is logged in on the system
  • whoami - display the effective current username
  • write - write a message to another user

[Home] [Search] [Index]
alphabetical/mx.html100644 1032 165141 3341 6113364533 14302 0ustar laufersnobody Index of manual pages: X

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

X

  • xargs - construct the arguments list(s) and execute a command
  • xstr - extract strings from C programs to implement shared strings

[Home] [Search] [Index]
alphabetical/my.html100644 1032 165141 3276 6113364533 14312 0ustar laufersnobody Index of manual pages: Y

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

Y

  • yacc - yet another compiler-compiler: parsing program generator
  • yes - be repetitively affirmative

[Home] [Search] [Index]
alphabetical/mz.html100644 1032 165141 3076 6113364533 14311 0ustar laufersnobody Index of manual pages: Z

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Manual pages are often copyrighted material. You may not have permission to view those held on this machine. If these links return an error message, view the page locally instead.

Z

  • zcat - display compressed files

[Home] [Search] [Index]
alphabetical/index.html100644 1032 165141 4750 6113364533 14772 0ustar laufersnobody On-line UNIX manual pages

On-line UNIX manual pages

The format and effects of commands can differ slightly between particular variants of the UNIX operating system. From here you can view the current manual pages for the machine which holds these UNIXhelp pages. This may not be the same machine that you use for your everyday work.

Mostly commands work in the same way from machine to machine. However for fine details you may wish to view the manual page on your local machine.

Many thanks to Panagiotis J. Christias (christia@theseas.ntua.gr) for his script to format these pages.

Select a letter to display the command names that begin with that letter. Selecting a command name displays the manual page for that command.

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

Important Note

Manual pages are proprietary information and are copyrighted to the manufacturer of each operating system. The owner of this UNIXhelp server may not have permission to give you a copy of their manual pages. If you get an error message instead of your desired manual page, you will have to view the page locally instead.


[Home] [Search] [Index]
basics/ 40755 1032 165141 0 6113364540 11523 5ustar laufersnobodybasics/basic1.2.html100644 1032 165141 1741 6115613724 14016 0ustar laufersnobody Problems with logging in

Problems with logging in

login incorrect
login:

Either you made a typing error while entering your username or password
or the <Caps Lock> key is on and everything is being sent to the system in uppercase letters.

UNIX is case sensitive. If your username is "kira", do not enter KIRA or Kira.


[Home] [Search] [Index]
basics/basic1.3.1.html100644 1032 165141 1351 6113364534 14153 0ustar laufersnobody Forgotten your password?

Forgotten your password?

Everyone does sooner or later. Contact your local system administrator and explain your problem to them.


[Home] [Search] [Index]
basics/basic1.3.2.html100644 1032 165141 1716 6113364534 14161 0ustar laufersnobody Special login files

Special login files

When you login to your account the system carries out any commands that it finds in special "login" files.

These commands define your working environment; which editor you use, which printer to send your work to and where to deliver printed output to.

Making changes to these login files changes your working environment.


[Home] [Search] [Index]
basics/basic1.3.3.html100644 1032 165141 1424 6113364534 14156 0ustar laufersnobody Your home directory

Your home directory

Once you are logged in to your account you are always placed in your home directory. This is your very own location in the file system: it never varies.


[Home] [Search] [Index]
basics/basic1.3.4.1.html100644 1032 165141 3054 6113364534 14317 0ustar laufersnobody Examples of using the who command

Examples of using the who command

To find out who is logged on to the system:

   who
   erco02   ttyPt   Nov  3 08:01   (braid.ucs:0.0)
   fran     ttyPu   Oct 26 11:23   (dirac.maths.ed.a)
   calvin   ttyPv   Nov  5 09:07   (hobbes.ucs.ed.ac)
   djs      ttyPx   Nov  5 11:39   (129.215.72.75)
   aipex    ttyPB   Nov  5 11:41   (owl.dai.ed.ac.uk)
   harvey   ttyPF   Nov  5 09:12   (rabbit.warren.ed)

This displays the name of the user, the date and time that they logged on and the name of their terminal.

Notice that a user might have been logged on for several days or even weeks.


To find out who is logged on and prevent the information from rolling off the screen:

   who | more

This sends the output from the who command through another program known as a pager which presents the information a page at a time.


[Home] [Search] [Index]
basics/basic1.3.4.html100644 1032 165141 1727 6113364535 14166 0ustar laufersnobody Who else is logged on?

Who else is logged on?

To find out if there are other users logged on to the system use the command:

who

This lists the username of each person that is currently logged on to the system. It also gives details about the terminal they are using and the date and time that they logged on.


[Home] [Search] [Index]
basics/basic1.3.html100644 1032 165141 1651 6113364535 14020 0ustar laufersnobody Did You Know?

Did You Know?

The following topics are related to your present task. Select an item for more information about it.


[Home] [Search] [Index]
basics/basic1.5.1.html100644 1032 165141 1312 6113364535 14153 0ustar laufersnobody Tip...

Tip...

To help you remember which account you are using, set the shell prompt so that it displays your username.


[Home] [Search] [Index]
basics/basic1.5.2.1.html100644 1032 165141 2473 6113364535 14324 0ustar laufersnobody Example of switching to another account

Example of switching to another account

To switch to another account from your current account:

   pwd
   /home/helper
   su projX
   Password: (password for account projX)
   whoami
   projX
   cd
   pwd
   /home/projX

The user helper switches to the account they have under the username projX and confirms this with the whoami command.

They then use the cd command to place themselves in the home directory for the account they have switched to. They can now work with the files and directories in this account in the usual way.


[Home] [Search] [Index]
basics/basic1.5.2.html100644 1032 165141 2042 6113364535 14155 0ustar laufersnobody Switching to another account

Switching to another account

To switch to using another account use the command

   su username

and enter your password when prompted.

You are still in the same working directory you were when you issued the command, but you now have access to the file system for your other account.

To stop using this account enter the command exit.


[Home] [Search] [Index]
basics/basic1.5.3.1.html100644 1032 165141 1702 6113364536 14320 0ustar laufersnobody Example of logging in to another account

Example of logging in to another account

To login to another account that you own from your current account:

   su - projX
   Password:
   You have new mail
   Mon Jul 27 15:35:46 WET DST 1992
   pwd
   /u/user/projX

This logs the user in to another account that they own with the username projX.


[Home] [Search] [Index]
basics/basic1.5.3.html100644 1032 165141 1764 6113364536 14171 0ustar laufersnobody Logging in to another account

Logging in to another account

To login to another account use the command

   su - username

and enter your password when prompted.

You are then logged into this account just like when you do your usual login.

To stop using this account enter the command logout or exit.


[Home] [Search] [Index]
basics/basic1.5.html100644 1032 165141 1754 6113364536 14027 0ustar laufersnobody Logging in more than once

Logging in more than once

You may have another account on the same system but under a different username.

To become this other user, either switch to another account or login to it from the account you are presently using.


[Home] [Search] [Index]
basics/basic1.html100644 1032 165141 2341 6113364536 13655 0ustar laufersnobody Logging on to the system

Logging on to the system

Before you can begin to use the system you will need to have been given a username and a password. Select the appropriate heading below for information on how to go about getting them.


[Home] [Search] [Index]
basics/basic2.1.html100644 1032 165141 1267 6113364536 14023 0ustar laufersnobody Example of logging out procedure

Example of logging out procedure

To logout enter the command:

   logout

[Home] [Search] [Index]
basics/basic2.2.1.html100644 1032 165141 2374 6115613744 14163 0ustar laufersnobody Example of logging out when there are stopped jobs

Example of logging out when there are stopped jobs

To logout when there are stopped jobs:

   man ls
   ....
   ....
   <Ctrl-z>
   Stopped
   logout	      
   There are stopped jobs.
   fg
   man ls
   --More--(8%)
   q
   logout

The user starts a job by entering the command to view the manual page for the ls command. They then "stop" this job with a the control key combination Ctrl-z.

It is not possible to logout until this "job" is started again and they quit from using it. They are then able to logout.


[Home] [Search] [Index]
basics/basic2.2.2.html100644 1032 165141 1675 6113364536 14167 0ustar laufersnobody Example of logging out from another shell

Example of logging out from another shell

To logout from another shell:

   logout
   Not login shell.
   exit
   logout

The user tries to logout from a shell that is not a login shell. They exit from this shell and are then able to logout.


[Home] [Search] [Index]
basics/basic2.2.html100644 1032 165141 3030 6115614000 13774 0ustar laufersnobody Problems with logging out

Problems with logging out

There are stopped jobs.

You have started a job by issuing a command and have then "stopped" the command from executing and placed it in the background using the key sequence Ctrl-z.

  1. Start the job again by typing fg and pressing the <Return> key.
  2. Quit the job or wait until it has finished.
  3. Try to logout again.

If you have several stopped jobs, you will have to go through this procedure for each one before you are able to logout.

Not login shell.

You are working in another shell that has been started from within your "login shell".

  1. Enter the command exit.
  2. Try to logout again.


[Home] [Search] [Index]
basics/basic2.3.html100644 1032 165141 1753 6113364537 14026 0ustar laufersnobody The logout file

The logout file

When you logout of your account the system carries out any commands held in a "logout" file which is in your home directory. The name of this file depends upon the type of shell you are using. The Bourne shell does not provide you with this facility.

Making changes to the commands in your logout file changes your working environment.


[Home] [Search] [Index]
basics/basic2.html100644 1032 165141 1673 6113364537 13666 0ustar laufersnobody Logging out

Logging out

To finish using a UNIX system you must go through a process known as "logging out".

To logout enter the command logout or exit. If this does not work press Ctrl-D.


[Home] [Search] [Index]
basics/basic3.1.html100644 1032 165141 2506 6113364537 14022 0ustar laufersnobody Example of changing a password with the passwd command

Example of changing a password with the passwd command

To change your password:

   passwd
   Old password: enter your current password
   New password: enter your new password
   Retype new password: re-enter your new password

Enter the command passwd and then respond to the prompts by entering your old password followed by your new one. You are then asked to confirm your new password.

The passwords will not appear on the screen as you type, to prevent other people from seeing them. If you make a mistake, the message

   Mismatch - password unchanged.

is displayed and your password remains unchanged. Try again.


[Home] [Search] [Index]
basics/basic3.2.html100644 1032 165141 2212 6113364537 14015 0ustar laufersnobody Guidelines for creating a password

Guidelines for creating a password

Don't

  • choose a word from a dictionary
  • use personal information such as your name, make of car etc.
  • tell anyone your password
  • write your password down anywhere
  • use the password you were given when you first got your account on the system

Do

  • choose an obscure password preferably between 6 and 8 characters in length, of mixed case and containing at least one non-alphanumeric character such as ! or @
  • change your password at regular intervals

[Home] [Search] [Index]
basics/basic3.html100644 1032 165141 2140 6113364537 13655 0ustar laufersnobody Changing your password

Changing your password

Your password is important; it stops other users from gaining access to your account. Never give your password to anyone, not even your best friend. If you do you may have your access to the use of the system suspended or withdrawn.

As an extra security measure change your password at regular intervals. Be sure to read the guidelines below before creating a new password for yourself.


[Home] [Search] [Index]
basics/index.html100644 1032 165141 2110 6113364537 13615 0ustar laufersnobody Basics

Basics

Here you can find out how to start and stop using a UNIX system and how to use some of its many commands.

If you have not used a UNIX system before look at the information in the Concepts menu or explore some of the other features of UNIXhelp.


[Home] [Search] [Index]
basics/basic1.1.html100644 1032 165141 2120 6113364540 14002 0ustar laufersnobody Example of the logging in procedure

Example of the logging in procedure

To login to your account:

login: calvin
Password:

This logs in the person who has been given the username calvin on this system. UNIX is case sensitive. If your username is "hobbes", do not enter HOBBES or Hobbes.

Your password is never displayed on the screen. If it were, other users might see it!


[Home] [Search] [Index]
commanz/ 40755 1032 165141 0 6113364546 11731 5ustar laufersnobodycommanz/cmd1.1.1.html100644 1032 165141 3642 6113364540 14035 0ustar laufersnobody Examples of using command arguments

Examples of using command arguments

To use a command with no argument:

   date

Entered on its own this command displays the current time and date.


To use a command with a single argument:

   cd newdir

The cd command (used to change from one directory to another) takes the name of the directory newdir as its argument.


To use a command with several arguments:

   cat file1 file2 file3

The cat command takes the names of three files as arguments. It prints file1 followed by file2 and then file3 on the screen. This explains the name of the command - it concatenates any files given to it as arguments.


To 'quote' an argument:

   ls 'part 1'

This lists information about the file part 1. The quotation marks ensure that the shell interprets the command line as the ls command followed by a single argument 'part 1'.

If the quotation marks were left out, the shell would interpret the command line as an instruction to list information about the file part and then the file 1.


[Home] [Search] [Index]
commanz/cmd1.1.html100644 1032 165141 2016 6113364540 13670 0ustar laufersnobody Command arguments

Command arguments

Most commands are used together with one or more arguments. For some commands these arguments are optional; others require you to use them with an argument.

If the argument contains an empty space then you must quote the argument.

Commands become far more effective when used together with regular expressions.


[Home] [Search] [Index]
commanz/cmd1.2.1.1.html100644 1032 165141 2741 6113364540 14174 0ustar laufersnobody Examples of using multiple options

Examples of using multiple options

Options can be grouped together:

   ls -FI

This lists the contents of the current directory. Directories are shown with a trailing '/'; files which have execute permission are shown with a trailing '*'.

The inode number of each file is also displayed.


Some options need to be given separately:

   lpr -Plp2 -#4rm report.ps

This prints four copies of the file report.ps, removes the file and sends mail to the user on completion.

The option -Plp2 which specifies the printer to be used is given separately from the other options. If the command were given as

   lpr -Plp2#4rm report.ps

the command would try to find a printer with the name lpr2#4rm.


[Home] [Search] [Index]
commanz/cmd1.2.1.html100644 1032 165141 2146 6113364541 14035 0ustar laufersnobody Using multiple options

Using multiple options

Some commands accept multiple options. These can be grouped together after a single hyphen:

     command -abc argument

A small number of commands require each option to be given separately. Check the command synopsis for a command to see how a command requires its options to be given.

An option that takes an argument, such as the name of a printer or a filename is given separately.


[Home] [Search] [Index]
commanz/cmd1.2.html100644 1032 165141 2123 6113364541 13671 0ustar laufersnobody Command options

Command options

Options modify the way that a command works. They usually consist of a hyphen followed by a single letter.

For example the wc command counts the number of words, characters and lines in a file. By using a different option you can choose what is counted.

   wc -w file1   counts the words
   wc -c file1   counts the characters
   wc -l file1   counts the lines

[Home] [Search] [Index]
commanz/cmd1.html100644 1032 165141 2372 6113364541 13537 0ustar laufersnobody About commands

About commands

The basic form of any Unix command is:

   command_name options argument(s)

Most descriptions for commands such as those given in the On-line Manual use a much more precise syntax. For example:

   cp [-iprR] filename ... directory

This syntax has a few simple rules. Apply them to the command description and you can understand how the command is to be used.


[Home] [Search] [Index]
commanz/cmd1a.html100644 1032 165141 2424 6113364541 13676 0ustar laufersnobody Command syntax rules

Command syntax rules

To understand the command syntax apply the following simple rules:

  1. Any options or arguments enclosed in [] square brackets are optional.

  2. Anything not enclosed in [] square brackets must be entered.

  3. Boldface words are considered to be literals and must be typed exactly as they appear. This usually applies to the command name and command options.

  4. Arguments shown in italics must be replaced by whatever it is that they represent. This is usually the name of a file or directory.

  5. Ellipses '...' mean that the previous argument can be repeated any number of times.


[Home] [Search] [Index]
commanz/cmd2.1.html100644 1032 165141 4150 6113364541 13673 0ustar laufersnobody Examples of commands

Examples of commands

To enter a simple command:

   ls

This command lists the contents of the current directory. In this example, no options or arguments are used.


To enter a command together with one of its options:

   ls -l

The -l option changes the way the ls command works. This command produces a listing of the contents of the current directory in a long format.


To enter a command together with several options and an argument:

   lpr -Pps5 -#3 -m foo.c

The option -Pps5 specifies that the file foo.c is to be printed on printer ps5. The option -#3 specifies that 3 copies of the file are to be printed. The option -m requests that a mail message is sent to the user once the command has been completed.


To enter a command with several arguments:

   lp part1 part2 part3

This will print the files part1, part2 and part3 on the default printer.


To enter a command using a regular expression as an argument:

   rm -i [pP]*.ps

This will prompt the user if they want to remove any file whose name matches the regular expression [pP]*.ps. This will remove a file with the name part1.ps and the file Personnel.ps.


[Home] [Search] [Index]
commanz/cmd2.2.1.html100644 1032 165141 4340 6115614111 14025 0ustar laufersnobody Examples of quoting special characters

Examples of quoting special characters

To remove the special meaning from a single metacharacter:

   rcp ubik:/home/roger/recipe.ps .;\\<Return>
   lpr -Pps3 #6m recipe.ps

This prevents the shell from expanding the newline character generated by pressing the <Return> key. You can then continue entering the command on the next line.


To prevent the shell from expanding an argument containing several special characters:

   $ sed -e 1,$s/V[0-9].*: //p /etc/motd
   sed: command garbled: 1,/V[0-9].*:
   $ sed -e '1,$s/V[0-9].*: //p' /etc/motd
   DYNIX/ptx(R) Tue Feb 25 12:04:15 GMT 1993

First, the shell tries to expand the command line and changes its meaning in the process. When the arguments to the command are protected by enclosing them in single quotes the sed command is successful. It displays the operating system version number contained in the message of the day.


To prevent the shell from expanding special characters but allow command substitution:

   echo 'My working directory is `pwd`'
   My working directory is`pwd`
   echo "My working directory is `pwd`"
   My working directory is /home/jane/docs

When enclosed within single quotes the characters `pwd` are treated literally as part of the string to be echoed. Placed within double quotes, the command within the backquotes is executed and its output substituted in its place.


[Home] [Search] [Index]
commanz/cmd2.2.2.html100644 1032 165141 2141 6113364542 14033 0ustar laufersnobody Guidelines for quoting command arguments

Guidelines for quoting command arguments

\\
prevent the shell from expanding any single special character.
' '
prevent the shell from expanding all special characters enclosed in this string except !.
" "
prevent the shell from expanding any enclosed special character except $, ` and !.

[Home] [Search] [Index]
commanz/cmd2.2.html100644 1032 165141 2124 6113364542 13674 0ustar laufersnobody Quoting command arguments

Quoting command arguments

Some characters, known as metacharacters, have a special meaning for the shell.

Always quote the command argument or regular expression if you want to prevent the shell from interpreting the special characters before passing it to the command.


[Home] [Search] [Index]
commanz/cmd2.3.html100644 1032 165141 2215 6113364542 13676 0ustar laufersnobody Entering more than one command

Entering more than one command

To enter several commands on the one command line, use a ; (semicolon) to seperate each one from the next. For example:

   cd ..; ls -l

This command line contains two commands. The first, cd .. changes the current directory to the parent directory. The second, ls -l produces a long listing of the contents of the curent directory.

If necessary you can continue the commands onto another line.


[Home] [Search] [Index]
commanz/cmd2.html100644 1032 165141 3213 6115614154 13533 0ustar laufersnobody Entering commands

Entering commands

To enter a command type its name followed by any options and arguments that you want the command to have. Leave one or more spaces between the command name, its options and arguments. If necessary you can continue the command onto another line.

Correct mistakes by using the <Delete> or <BackSpace> key to back up along the command line and correct it.


[Home] [Search] [Index]
commanz/cmd2a.html100644 1032 165141 3174 6115614234 13701 0ustar laufersnobody Continuing a command onto another line

Continuing a command onto another line

To continue a command onto another line enter a '\\' (backspace) character and then press <Return>. You can then continue entering the command. For example:

   rcp ubik:/home/roger/recipe.ps .;\\<Return>
   lpr -Pps3 #6m recipe.ps

This copies the file recipe.ps from the home directory of the user roger on the remote host ubik to the users current directory. It then sends this job to the printer ps3 with the request that 6 copies are printed.

This person ought to use a photocopier!

If you are using the Bourne, BASH or Korn shell a > character appears as a prompt at the start of the second command line. For example:

   ls -l | grep '^d.........x' > dirs;\\
   > less dirs

Users of the C or Tcsh shell do not receive this prompt.


[Home] [Search] [Index]
commanz/cmd3.1.html100644 1032 165141 2000 6115614267 13671 0ustar laufersnobody Redirecting standard input

Redirecting standard input

To redirect the standard input for a command use the < (less than) character followed by the name of the input file. For example:

   mail tony < memo

This redirects the standard input to the mail command so that it comes from the file memo. The effect of this is to mail the contents of this file to the user tony.


[Home] [Search] [Index]
commanz/cmd3.2.1.html100644 1032 165141 1372 6113364543 14041 0ustar laufersnobody **Caution**

**Caution**

Redirecting standard output to a file that already exists overwrites its contents with the standard output.

You can append output to an existing file.


[Home] [Search] [Index]
commanz/cmd3.2.2.html100644 1032 165141 2525 6113364543 14043 0ustar laufersnobody Did You Know?

Did You Know?

When a command is carried out successfully, the results are sent to the standard output file. But if the command fails to execute successfully the results are displayed on the standard error file -your terminal. For example:

   ls -l part1.txt
   part1.txt not found

The ls command fails because the file part1.txt does not exist in the current directory. A message is sent to the standard error - your terminal - informing you of this.

You can redirect the standard error away from your terminal to another file but this is generally discouraged. The method for doing this also varies slightly with different shells. Consult the manual page for the shell that you are using for further details.


[Home] [Search] [Index]
commanz/cmd3.2.html100644 1032 165141 2423 6115614312 13672 0ustar laufersnobody Redirecting standard output

Redirecting standard output

To redirect the standard output from a command use the > (greater than) symbol followed by the name of the output file. If the file that you redirect standard output to does not already exist it will be created. For example:

   grep Smith /etc/passwd > popular

This redirects the standard output from the grep command so that it goes to the file popular. This file will contain all occurrences of the string Smith that were found in the /etc/passwd file.


[Home] [Search] [Index]
commanz/cmd3.3.html100644 1032 165141 2324 6115614344 13700 0ustar laufersnobody Appending standard output to a file

Appending standard output to a file

To append the standard output from a command to a file use two >> (greater than) symbols followed by the name of the file. If the file does not exist it is created. For example:

   cat part1 > chapt2
   cat part2 >> chapt2

This creates a file called chapt2 with the same contents as part1. It then reads the contents of part2 and appends them to the file chapt2. The file chapt2 now contains the data from part1 followed by the data from part2.


[Home] [Search] [Index]
commanz/cmd3.html100644 1032 165141 2354 6113364544 13544 0ustar laufersnobody Redirecting standard input and output

Redirecting standard input and output

Unix considers any device attached to the system to be a file. And that includes your terminal!

By default, a command treats your terminal as the standard input file from which to read in information. Your terminal is also treated as the standard output file to which information is sent from the command.

This action can be changed by redirecting standard input and standard output from and to any other file.


[Home] [Search] [Index]
commanz/cmd4.1.html100644 1032 165141 3272 6113364544 13704 0ustar laufersnobody Examples of using pipelines to connect commands

Examples of using pipelines to connect commands

To pipe the output from one command into another command:

   who | wc -l
   342

This command tells you how many users are currently logged in on the system: a lot!

The standard output from the who command - a list of all the users currently logged in on the system - is piped into the wc command as its standard input. Used with the -l option this command counts the numbers of lines in the standard input and displays the result on the standard output.


To connect several commands together:

   ps -aux|grep joe|sort +5 -6|less

The first command ps -aux outputs information about the processes currently running. This information becomes the input to the command grep joe which searches for any lines that contain the username "joe". The output from this command is then sorted on the sixth field of each line, with the output being displayed one screenful at a time using the less pager.


[Home] [Search] [Index]
commanz/at.html100644 1032 165141 2153 6113364544 13317 0ustar laufersnobody Running commands at a specific time

Running commands at a specific time

To execute a command at a specific time use the at command. See the manual page for more details.

Commands can be scheduled to execute at regular intervals using the crontab command, which submits crontab job files for execution by the cron daemon. See the manual page for further details.


[Home] [Search] [Index]
commanz/cmd4.html100644 1032 165141 2171 6113364544 13542 0ustar laufersnobody Connecting commands together

Connecting commands together

Unix allows you to link two or more commands together using a pipe. The pipe takes the standard output from one command and uses it as the standard input to another command.

   command1 | command2 | command3

The | (vertical bar) character is used to represent the pipeline connecting the commands.

With practise you can use pipes to create complex commands by combining several simpler commands together.


[Home] [Search] [Index]
commanz/cmd5.1.html100644 1032 165141 3535 6113364544 13707 0ustar laufersnobody Examples of locating commands with the which command

Examples of locating commands with the which command

To find out if a command name is located in your command path:

   which ue
   /usr/local/bin/ue

This returns the information that the MicroEMACS editor (ue) is available on this system as the file /usr/local/bin/ue.


To find out if the Korn shell is available on your system:

   which ksh
   /bin/ksh

This returns the information that the Korn shell is available on your system in the directory /bin.


To find out which (if any) of several commands are available:

   which delete talk ps
   No delete in /usr/local/utils/bin:/bin:/usr/bin:
   /usr/local/ucb/bin:/usr/local/gnu/bin:
   /usr/local/public/bin:/usr/bin/X11:.
   /usr/bin/talk
   /bin/ps

This returns the information that the file for the command delete does not exist in any of the directories that are specified in this user's PATH environment variable.

Pathnames for the files of the commands talk and ps are displayed, so these commands are available on this system.


[Home] [Search] [Index]
commanz/cmd5.html100644 1032 165141 1770 6113364545 13550 0ustar laufersnobody Locating a command

Locating a command

To find out if a command or utility is available on your system enter the command:

   which command_name

If the command is found its pathname is displayed. The message

   command_name: Command not found

is displayed when the command cannot be found.


[Home] [Search] [Index]
commanz/cmd_sub.html100644 1032 165141 2157 6113364545 14334 0ustar laufersnobody Command substitution

Command substitution

To include the output from one command within the command line for another command, enclose the command whose output is to be included within `backquotes`. For example:

   echo The date today is `date +%d/%m/%y`
   The date today is 17/05/95

The output from the command date +%d/%m/%y is substituted at the appropriate location within a command line that uses the echo command.


[Home] [Search] [Index]
commanz/index.html100644 1032 165141 2673 6113364545 14032 0ustar laufersnobody Using UNIX commands

Using UNIX commands

You interact with the Unix operating system by entering a command at the shell prompt.

You can look up the command in the On-line Manual for a complete description of it.


[Home] [Search] [Index]
commanz/path1.1.html100644 1032 165141 2342 6113364545 14070 0ustar laufersnobody Path Lists

Path Lists

A typical value for the PATH variable might be:

   /bin:/usr/bin:/usr/local/utils/bin:$HOME/bin

This is a path list of colon separated pathnames to the directories that contain the executable binary files for each command.

The shell will first look for the command that has been entered in the directory /bin. If it is not found there it will then look in the directory /usr/bin and so on until the command is found.

If the command is not found on your path the message

   command_name: command not found

is displayed.


[Home] [Search] [Index]
commanz/path1.html100644 1032 165141 2327 6113364545 13734 0ustar laufersnobody Where are commands located?

Where are commands located?

Unix commands are executable binary files located in directories with the name bin (for binary). Many of the commands that you use are located in the directory /usr/bin.

When you enter the name of a command the shell checks to see if it is a built-in command. If it is not, it looks for the the binary file that the command name refers to in each of the directories that are defined in the PATH environment variable.


[Home] [Search] [Index]
commanz/path2.html100644 1032 165141 1767 6113364546 13745 0ustar laufersnobody Making other commands available

Making other commands available

The value of the PATH variable is set so that you have access to the commands available on your system.

You can use commands that are not on your path list by setting a new value for the PATH environment variable.


[Home] [Search] [Index]
commanz/sleep.html100644 1032 165141 2771 6113364546 14033 0ustar laufersnobody Suspending commands with the sleep command

Suspending commands with the sleep command

To suspend the execution of a command for a specific amount of time use the command:

   sleep time_in_seconds; command

The second command will not be carried out until the amount of time specified as an argument to the sleep command has elapsed. The semicolon (;) is used to allow the two commands to be entered on the same command line.

You can also enclose the commands in parentheses to group them together and then run the combined command in the background, allowing you to carry on working at the shell prompt:

   (sleep time_in_seconds; command) &

This command is very useful if you need to do something else before a command is executed.


[Home] [Search] [Index]
commanz/sleep1.html100644 1032 165141 2224 6113364546 14105 0ustar laufersnobody Example of using the sleep command

Example of using the sleep command

To set an interval before a command is executed:

   (sleep 10; xwd -out zmail.xwd) &

This gives the user 10 seconds to change the appearance of, say, their X window display before the xwd command is executed to save the image of the current window to the file zmail.xwd.

The first command line is run as a background job to allow the user to continue entering commands.


[Home] [Search] [Index]
concepts/ 40755 1032 165141 0 6113364560 12077 5ustar laufersnobodyconcepts/currdir.html100644 1032 165141 1750 6113364546 14543 0ustar laufersnobody Current directory

Current directory

When you log on to the system you are always placed in your home directory. At first this is your current directory.

If you then change to another directory this becomes your current directory. The command pwd displays the full pathname to your current directory.


[Home] [Search] [Index]
concepts/dev.html100644 1032 165141 1432 6113364547 13645 0ustar laufersnobody The /dev directory

The /dev directory

This directory contains special files used to represent real physical devices such as printers and terminals. One of these files represents a null (non-existent) device.


[Home] [Search] [Index]
concepts/etc.html100644 1032 165141 1527 6113364547 13647 0ustar laufersnobody The /etc directory

The /etc directory

This directory contains various commands and files which are used for system administration. One of these files - motd - contains a 'message of the day' which is displayed whenever you login to the system.


[Home] [Search] [Index]
concepts/file.html100644 1032 165141 2454 6113364547 14013 0ustar laufersnobody Understanding UNIX files

Understanding UNIX files

Files do not actually reside inside directories. A directory is a file that contains references to other files. The directory holds two pieces of information about each file:

  • its filename
  • an inode number which acts as a pointer to where the system can find the information it needs about this file.

Filenames are only used by the system to locate a file and its corresponding inode number. This correspondence is called a link.

To the system, the file is the inode number. Multiple filenames can be used to refer to the same file by creating a link between an inode and each of the filenames.


[Home] [Search] [Index]
concepts/fsystem.html100644 1032 165141 2270 6113364547 14562 0ustar laufersnobody UNIX file system

UNIX file system

A file system is a logical method for organising and storing large amounts of information in a way which makes it easy manage. The file is the smallest unit in which information is stored. The UNIX file system has several important features.


[Home] [Search] [Index]
concepts/index.html100644 1032 165141 2234 6113364547 14177 0ustar laufersnobody Operating system

Operating system

An operating system is the program that controls all the other parts of a computer system - both the hardware and the software. Most importantly, it allows you to make use of the facilities provided by the system. Every computer has an operating system.

The UNIX operating system has three important features; a kernel, the shell and a filesystem.


[Home] [Search] [Index]
concepts/kernel.html100644 1032 165141 3061 6113364547 14347 0ustar laufersnobody The Kernel

The Kernel

As its name implies, the kernel is at the core of each UNIX system and is loaded in whenever the system is started up - referred to as a boot of the system.

It manages the entire resources of the system, presenting them to you and every other user as a coherent system. You do not need to know anything about the kernel in order to use a UNIX system. This information is provided for your information only.

Amongst the functions performed by the kernel are:

  • managing the machine's memory and allocating it to each process.
  • scheduling the work done by the CPU so that the work of each user is carried out as efficiently as is possible.
  • organising the transfer of data from one part of the machine to another.
  • accepting instructions from the shell and carrying them out.
  • enforcing the access permissions that are in force on the file system.

[Home] [Search] [Index]
concepts/kernel1.1.html100644 1032 165141 2424 6113364550 14563 0ustar laufersnobody Location of the kernel file

Location of the kernel file

The root directory contains both the boot program and the file containing the kernel for the system. The name of this kernel file varies from one manufacturer's machine to another, but will usually include the letters nix so you can search for it with wildcard characters. For example:

   ls /*nix*
   -rwxr-----  1 root      1558734 Sep 24  1992 /vmunix

This lists details of any files in the root directory with the characters nix in their name. In this example it lists vmunix - a common name for the kernel file.


[Home] [Search] [Index]
concepts/kernel1.2.html100644 1032 165141 2163 6113364550 14564 0ustar laufersnobody More about the UNIX operating system

More about the UNIX operating system

Strictly speaking, UNIX is not one single operating system, it is a family of operating systems. Different computer manufacturers produce their own versions of UNIX.

Although these are mostly similar, there are small differences which can cause problems. The most obvious examples are the layout of the file system and the exact format of certain commands.


[Home] [Search] [Index]
concepts/kernel1.html100644 1032 165141 1503 6113364550 14421 0ustar laufersnobody Did You Know?

Did You Know?

The following topics are related to your present task. Select an item for more information about it.


[Home] [Search] [Index]
concepts/lib.html100644 1032 165141 1453 6113364550 13632 0ustar laufersnobody The /lib directory

The /lib directory

This directory contains libraries that are used by various programs and languages.

Often in modern UNIX systems this directory is simply a link to /usr/lib.


[Home] [Search] [Index]
concepts/null.html100644 1032 165141 1554 6113364551 14041 0ustar laufersnobody /dev/null

/dev/null

There is a special device know as /dev/null to which you can redirect unwanted output. This is a null (non-existent) device represented by the file null in the directory /dev .


[Home] [Search] [Index]
concepts/opfile.html100644 1032 165141 1741 6113364551 14343 0ustar laufersnobody Different types of file

Different types of file

To you, the user, it appears as though there is only one type of file in UNIX - the file which is used to hold your information. In fact, the UNIX filesystem contains several types of file.


[Home] [Search] [Index]
concepts/opfile1.html100644 1032 165141 2215 6113364551 14421 0ustar laufersnobody Ordinary files

Ordinary files

This type of file is used to store your information, such as some text you have written or an image you have drawn. This is the type of file that you usually work with.

Files which you create belong to you - you are said to "own" them - and you can set access permissions to control which other users can have access to them. Any file is always contained within a directory.


[Home] [Search] [Index]
concepts/opfile2.html100644 1032 165141 2376 6113364551 14432 0ustar laufersnobody Directories

Directories

A directory is a file that holds other files and other directories. You can create directories in your home directory to hold files and other sub-directories.

Having your own directory structure gives you a definable place to work from and allows you to structure your information in a way that makes best sense to you.

Directories which you create belong to you - you are said to "own" them - and you can set access permissions to control which other users can have access to the information they contain.


[Home] [Search] [Index]
concepts/opfile3.html100644 1032 165141 2440 6115614427 14425 0ustar laufersnobody Special files

Special files

This type of file is used to represent a real physical device such as a printer, tape drive or terminal.

It may seem unusual to think of a physical device as a file, but it allows you to send the output of a command to a device in the same way that you send it to a file. For example:

cat scream.au > /dev/audio

This sends the contents of the sound file scream.au to the file /dev/audio which represents the audio device attached to the system. Guess what sound this makes?

The directory /dev contains the special files which are used to represent devices on a UNIX system.


[Home] [Search] [Index]
concepts/opfile4.html100644 1032 165141 1412 6113364552 14423 0ustar laufersnobody Pipes

Pipes

UNIX allows you to link commands together using a pipe.

The pipe acts a temporary file which only exists to hold data from one command until it is read by another.


[Home] [Search] [Index]
concepts/pathfile.html100644 1032 165141 4220 6113364552 14655 0ustar laufersnobody Pathnames

Pathnames

Every file and directory in the file system can be identified by a complete list of the names of the directories that are on the route from the root directory to that file or directory.

Each directory name on the route is separated by a / (forward slash). For example:

/usr/local/bin/ue

This gives the full pathname starting at the root directory and going down through the directories usr, local and bin to the file ue - the program for the MicroEMACS editor.

You can picture the full pathname as looking like this:


                      /(root)
                         |
                         | 
                ---------------------
                  |              |
                 tmp            usr
                                 |
                          ---------------- ... ----
                          |        |              |
                       /games   /local         /spool
                                   |
                            ---------------
                                |
                              /bin
                                |
                                ---------
                                        |
                                        ue


[Home] [Search] [Index]
concepts/pathfile2.1.html100644 1032 165141 4141 6113364553 15101 0ustar laufersnobody Examples of using relative pathnames

Examples of using relative pathnames

To give a relative path to a file below your current directory:

   pwd (prints the current directory)
   /home/eucs/jane (the full pathname to the current directory)
   ls -l presentation/docs/oview.html (lists information
                                       on the file)

This defines the file oview.html in the directory docs which is in the directory presentation which itself is a directory in the current directory.


To define a file that is in another directory:

   pwd (prints the current directory)
   /home/eucs/jane/presentation/docs (the full pathname)
   cd ../illustrations (use relative pathname)
   pwd (check the current directory)
   /home/eucs/jane/presentation/illustrations

The user jane uses the relative pathname ../illustrations to move up to the directory presentation and then down into the directory illustrations.


To give a pathname using the ~ character:

   cp ~fran/tmp/for_mike.txt

This copies the file for_mike.txt from the directory ~fran/tmp. The ~ (tilde) character is used to save giving the full pathname to fran's home directory.


[Home] [Search] [Index]
concepts/pathfile2.html100644 1032 165141 2513 6113364553 14743 0ustar laufersnobody Relative pathnames

Relative pathnames

You can define a file or directory by its location in relation to your current directory. The pathname is given as / (slash) separated list of the directories on the route to the file (or directory) from your current directory.

A .. (dot dot) is used to represent the directory immediately above the current directory.

In all shells except the Bourne shell, the ~ (tilde) character can be used as shorthand for the full pathname to your home directory.


[Home] [Search] [Index]
concepts/procs.html100644 1032 165141 3161 6113364553 14213 0ustar laufersnobody Processes

Processes

When you enter a command it invokes a program. While this program is running it is called a process. It is important to grasp that although there is only one copy of a program held in the file system, any number of processes can be invoked which run this program.

When the operating system is started after a boot, a single process is started. This process is the parent of all subsequent processes. Each process created on the system has a unique number, known as its PID, associated with it.

When you login to the system a process is started to run your shell program. Any processes that are started from within your shell - such as entering a command - are the children of this process. A process can have many children, but only one parent.

See Managing jobs and processes for further information.


[Home] [Search] [Index]
concepts/regexp.html100644 1032 165141 2354 6113364553 14362 0ustar laufersnobody Regular expressions

Regular expressions

A regular expression is a concise way of expressing any pattern of characters.

You construct a regular expression by combining ordinary characters with one or more metacharacters: characters that have special meaning for the shell.

Regular expressions can be used to:

Commands differ in the range of the regular expressions that they support. Check the manual page for the command for further details.


[Home] [Search] [Index]
concepts/regexp1.1.html100644 1032 165141 3200 6113364554 14572 0ustar laufersnobody Examples of using regular expressions for file names

Examples of using regular expressions for file names

To list all files with a particular extension:

   ls *.fm

This will list all the files in the current directory that have the extension .fm.


To remove a range of files:

   rm prog.?

This removes all the files in the current directory with a single character extension to their name. Files foo.c and foo.o would be removed as would file foo.3.


To copy all the files containing the same pattern:

   cp [pP]art[0-9] ../book

This copies all files whose name contains a pattern that starts with either p or P followed by the letters art and ending in any number from 0 through to 9.

So the file part1 would be copied to the parent directory book as would the file Part7.


[Home] [Search] [Index]
concepts/regexp1.html100644 1032 165141 2204 6113364555 14437 0ustar laufersnobody Matching file names with regular expressions

Matching file names with regular expressions

You can use the following metacharacters within any shell to create regular expressions that match file names.

   ?       matches any single character
   *       matches any number of any characters
   [nnn]   matches any of the enclosed characters
   [!nnn]  matches any character that is not enclosed
   [n-n]   matches any character in this range

[Home] [Search] [Index]
concepts/regexp2.1.html100644 1032 165141 2612 6113364556 14603 0ustar laufersnobody Example of removing special meaning from a metacharacter

Example of removing special meaning from a metacharacter

To make the shell interpret a metacharacter literally:

   echo &
   [1] 1463
   [1]    Done                 echo
   echo \\&
   &

The shell interprets the & character at the end of a command line to mean that the command is to be run in the background. So the command echo & simply runs the echo command in the background and since the command has nothing to echo it immediately exits.

When the & character is preceded by a \\ (backslash) the echo command interprets this literally and simply echoes (displays) this character on the screen.


[Home] [Search] [Index]
concepts/regexp2.html100644 1032 165141 2616 6115614473 14446 0ustar laufersnobody Characters with special meaning for the shell

Characters with special meaning for the shell

The characters

   ;  &  ( )  |  ^  <  >  ~  %  { }
   $  #   '  "  \  @@  *  ?  [ ]  -  !
   Newline (a <Return>)
   Space   (a <Space>)
   Tab	   (a <Tab>)

are all shell metacharacters. To the shell, they represent something other than the character or symbol that they are.

You must quote any command argument or regular expression containing one or more of these, so that it is passed to the command unchanged.


[Home] [Search] [Index]
concepts/strctfile.html100644 1032 165141 2414 6113364556 15067 0ustar laufersnobody Structure of the file system

Structure of the file system

The UNIX file system is organised as a hierarchy of directories starting from a single directory called root which is represented by a / (slash). Imagine it as being similar to the root system of a plant or as an inverted tree structure.

Immediately below the root directory are several system directories that contain information required by the operating system. The file holding the UNIX kernel is also here.


[Home] [Search] [Index]
concepts/strctfile1.html100644 1032 165141 2561 6113364557 15154 0ustar laufersnobody UNIX system directories

UNIX system directories

The standard system directories are shown below. Each one contains specific types of file. The details may vary between different UNIX systems, but these directories should be common to all. Select one for more information on it.

                              /(root)
                                 |
 --------------------------------------------------------------
 |         |       |       |        |       |       |         |
 /bin    /dev    /etc    /home    /lib    /tmp    /usr   kernel file

[Home] [Search] [Index]
concepts/strctfile2.1.html100644 1032 165141 3253 6113364557 15313 0ustar laufersnobody Example of location of a home directory

Example of location of a home directory

Although both Joe and Sarah are registered as users on their local UNIX system, they belong to different departments; Joe is a postgrad student in artificial intelligence while Sarah is Head of the Math Department. Their respective home directories might be:


          /(root)
             |
             |
   ----------------------
     |              |
    /tmp          /home
     |              |
         ---------------- ... ----
         |         |             |
        /ai      /biol          /math
         |                       |
    ----------             ---------------
    |                                    |
  /joe                                /staff
                                         |             
                              ------------------
                                               |
                                            /sarah

The full pathname to Joe's home directory is /home/ai/joe - that to Sarah's is /home/math/staff/sarah.


[Home] [Search] [Index]
concepts/strctfile2.html100644 1032 165141 2242 6113364557 15151 0ustar laufersnobody Home Directory

Home Directory

Any UNIX system can have many users on it at any one time. As a user you are given a home directory in which you are placed whenever you log on to the system.

User's home directories are usually grouped together under a system directory such as /home. A large UNIX system may have several hundred users, with their home directories grouped in subdirectories according to some schema such as their organisational department.


[Home] [Search] [Index]
concepts/tmp.html100644 1032 165141 1335 6113364557 13672 0ustar laufersnobody The /tmp directory

The /tmp directory

This directory acts as a "scratch" area in which any user can store files on a temporary basis.


[Home] [Search] [Index]
concepts/usr.html100644 1032 165141 1455 6113364560 13700 0ustar laufersnobody The /usr directory

The /usr directory

This directory contains system files and directories that you share with other users. Application programs, on-line manual pages, and language dictionaries typically reside here.


[Home] [Search] [Index]
concepts/home.html100644 1032 165141 1276 6113364560 14020 0ustar laufersnobody The /home directory

The /home directory

This directory contains a home directory for each user of the system.


[Home] [Search] [Index]
concepts/history.html100644 1032 165141 3245 6113364560 14567 0ustar laufersnobody History of the UNIX operating system

History of the UNIX operating system

The first version of UNIX was created in 1969 by Kenneth Thompson and Dennis Ritchie, system engineers at AT&T's Bell Labs. It went through many revisions and gained in popularity until 1977, when it was first made commercially available by Interactive Systems Corporation.

At the same time a team from the University of California at Berkeley was working to improve UNIX. In 1977 it released the first Berkeley Software Distribution, which became known as BSD. Over time this won favour through innovations such as the C shell.

Meanwhile the AT&T version was developing in different ways. The 1978 release of Version 7 included the Bourne Shell for the first time. By 1983 commercial interest was growing and Sun Microsystems produced a UNIX workstation. System V appeared, directly descended from the original AT&T UNIX and the prototype of the more widely used variant today.


[Home] [Search] [Index]
concepts/sysvbsd.html100644 1032 165141 2411 6113364560 14555 0ustar laufersnobody Modern variants of UNIX

Modern variants of UNIX

There are two main versions of UNIX in use today: System V and BSD. System V is the more popular of the two.

From a user's perspective they are very similar and you are unlikely to have difficulty unless you use more than one type of system. In this case you might notice differences in the structure of the file system or in how certain commands behave. The on-line manual should be helpful if you have problems.

Although UNIXhelp is now based on a System V variant of UNIX, you should see only minor differences in the example input and output if your system is a BSD one.


[Home] [Search] [Index]
concepts/bin.html100644 1032 165141 1753 6113364561 13641 0ustar laufersnobody The /bin directory

The /bin directory

This directory contains the commands and utilities that you use day to day. These are executable binary files - hence the the directory name bin.

Often in modern UNIX systems this directory is simply a link to /usr/bin.


[Home] [Search] [Index]
didyou/ 40755 1032 165141 0 6113364565 11563 5ustar laufersnobodydidyou/biff.html100644 1032 165141 1652 6113364561 13454 0ustar laufersnobody biff: Did You Know?

biff: Did You Know?

"Biff was Heidi Stettner's dog, back when Heidi (and I and Bill Joy) were all grad students at U.C.Berkley and the early versions of BSD were being developed. Biff was popular among the residents of Evans Hall, and was known for barking at the mailman, hence the name of the command."

Eric Cooper


[Home] [Search] [Index]
didyou/bill.html100644 1032 165141 1246 6113364562 13470 0ustar laufersnobody Bill Joy

Bill Joy

Bill Joy was the creator of the C shell and a founding member of Sun Microsystems.


[Home] [Search] [Index]
didyou/cat.html100644 1032 165141 2120 6113364562 13305 0ustar laufersnobody Did You Know?

Did You Know?

The cat command is the simplest of filters. It copies its standard input (stdin) to the standard output (stdout).

By default your terminal acts as both stdin and stdout. What you type on the keyboard (stdin) is copied to your display (stdout).

When cat encounters the EOF (End of file) sequence generated by Ctrl-d it takes this to mean that there is no more input to follow and copies it to the file.


[Home] [Search] [Index]
didyou/chsh.html100644 1032 165141 1676 6113364562 13502 0ustar laufersnobody Did You Know?

Did You Know?

A quick way to see what shells are available on a your system is to display the file /etc/shells. For example:

   cat /etc/shells
   /bin/sh
   /bin/csh
   /usr/local/bin/Tcsh
   /usr/local/bin/bash

This file contains the full pathnames for every shell that is available on your system.


[Home] [Search] [Index]
didyou/copy5.html100644 1032 165141 1511 6113364562 13600 0ustar laufersnobody Did You Know?

Did You Know?

The following topics are related to your present task. Select an item for more information about it.


[Home] [Search] [Index]
didyou/create.html100644 1032 165141 1243 6113364563 14007 0ustar laufersnobody Did You Know?

Did You Know?

You can create an exact copy of a file by making a copy of it.


[Home] [Search] [Index]
didyou/jobz.html100644 1032 165141 1747 6113364563 13521 0ustar laufersnobody Did You Know?

Did You Know?

The following topics are related to your present task. Select an item for more information about it.


[Home] [Search] [Index]
didyou/kill.html100644 1032 165141 3214 6113364563 13477 0ustar laufersnobody Did You Know?

Did You Know?

Each process is controlled by sending signals to it which tell it what to do. This is how the kill command has its effect; by sending a process a signal which tells it to stop, hang up or terminate etc.

You can list the different types of signal that can be sent to a process by using the kill command together with its -l option. For example:

   kill -l
    1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL
    5) SIGTRAP      6) SIGIOT       7) SIGEMT       8) SIGFPE
    9) SIGKILL     10) SIGBUS      11) SIGSEGV     12) SIGSYS
   13) SIGPIPE     14) SIGALRM     15) SIGTERM     16) SIGUSR1
   17) SIGUSR2     18) SIGCHLD     19) SIGPWR      20) SIGWINCH
   21) SIGURG      22) SIGIO       23) SIGSTOP     24) SIGTSTP
   25) SIGCONT     26) SIGTTIN     27) SIGTTOU     28) SIGVTALRM
   29) SIGPROF

Signal type 1 (one) will send a process a signal to hang up (SIGHUP): signal type 9 (nine) is a signal to kill (SIGKILL) the process. This is certain to kill it.


[Home] [Search] [Index]
didyou/mail.html100644 1032 165141 2100 6113364563 13457 0ustar laufersnobody Joint Academic NETwork

The Joint Academic NETwork

The system you are using is probably linked to nearby systems by a local network.

This network, together with many others, may be linked to another larger network. For example, the Joint Academic NETwork (JANET), is a national network linking togther networks in Universities, Colleges and Research Institutes within the United Kingdom.

The JANET network is part of the Internet, which brings regional, enterprise and national networks together to form a worldwide network.


[Home] [Search] [Index]
didyou/mail1.html100644 1032 165141 1575 6113364563 13557 0ustar laufersnobody About mail files

About mail files

Mail files are simply text files, with a format that the mail program understands. You can process them with any of the standard UNIX utilities like grep, and read them with editors or paginators.


[Home] [Search] [Index]
didyou/mail2.html100644 1032 165141 2177 6113364564 13560 0ustar laufersnobody Switching to other mailbox files

Switching to other mailbox files

You can quit reading the current mailbox file and switch to reading another one with the command:

   folder filename

For example

   folder +usability

reads in the mail messages in the file usability which is in the folder directory.

Other filenames are:

   %	your system mailbox
   #	the previous mail file that you were reading
   &	your personal mbox file

[Home] [Search] [Index]
didyou/pager.html100644 1032 165141 1637 6113364564 13652 0ustar laufersnobody Did You Know?

Did You Know?

The following topics are related to your present task. Select an item for more information about it.

Online manual pages are displayed using another program known as "pager".


[Home] [Search] [Index]
didyou/path.html100644 1032 165141 2067 6113364564 13506 0ustar laufersnobody Did You Know?

Did You Know?

You can use a command by giving the full pathname to it. For example:

   ~amy/project/beta/bin/minder

This will run the command minder which is located in the directory project/beta/bin in the home directory of the user amy. The ~ (tilde) character is used as shorthand for the path to the user's home directory.


[Home] [Search] [Index]
didyou/tarmail.html100644 1032 165141 4031 6113364564 14174 0ustar laufersnobody Sending binary files through the mail

Sending binary files through the mail

You can mail binary files between Unix systems that have the tarmail or uuencode utilities installed. Use the which command to find out if it is available on your system. More on uuencode.

The tarmail command converts the binary file into a text file and then compresses it to reduce its size. It then mails the file to the address given. For example:

   tarmail joe@psy.gla.ac.uk "prog i promised u" a.out

This sends the file a.out to the person whose mail address is joe@psy.gla.ac.uk The quoted text is used as information for the Subject: field.

tarmail can be used to send several files in the same mail message. For example:

   tarmail bill@fish.com "that prog" prog.c a.out

This "tars up" the files prog.c and a.out into the single mail message.

Once the mail message containing the file reaches its destination, the person can save the mail message to a file and then decode the file using the untarmail command. For example:

   untarmail fromjohn

[Home] [Search] [Index]
didyou/username.html100644 1032 165141 1655 6113364564 14373 0ustar laufersnobody Displaying your current username

Displaying your current username

To display the current effective username by which you are known to the system use the command:

   whoami

This is a useful command if you have several accounts on a system and switch between them using the su command.


[Home] [Search] [Index]
didyou/vi.1.html100644 1032 165141 2737 6115614562 13331 0ustar laufersnobody Entering carriage returns

Entering carriage returns

For vi, a line is the string of characters between two <RETURN> characters.

Although vi will automatically wrap the text onto a new line when it reaches the right-hand side of the screen, it does not insert a <RETURN> character. Lines of text as they appear on your screen do not necessarily correspond to how vi understands their structure. This can give you problems when you use vi commands to move around the text as you edit it.

Adding a <RETURN> at the end of every line ensures that the appearance of the text on your screen corresponds to vi's understanding of how text is structured.

Setting the wrapmargin option automatically inserts a <RETURN> character whenever vi wraps text.


[Home] [Search] [Index]
didyou/vi.2.html100644 1032 165141 1747 6115614600 13323 0ustar laufersnobody Setting a wrap margin

Setting a wrap margin

Set an option and avoid having to insert a carriage return at the end of every line.

Set the wrapmargin (wm) option to a value greater than 0 (zero). For example:

   set wm=5

In insert mode, text is wrapped five (5) characters from the right margin of the screen and a <RETURN> character is automatically inserted.


[Home] [Search] [Index]
didyou/vi.3.html100644 1032 165141 2161 6113364565 13325 0ustar laufersnobody Recovering a file after a system crash

Recovering a file after a system crash

Suppose the system fails while you are editing a file! You can recover the file when you next log on to the system again by using the -r option to the vi command. For example:

   vi -r help.xdh

This restores the vi buffer for the file help.xdhto exactly the state it was in immediately before the system failed.

You can continue to edit the file or write the contents of the buffer to the file.


[Home] [Search] [Index]
didyou/vi.4.html100644 1032 165141 2157 6113364565 13333 0ustar laufersnobody Creating multiple vi environments

Creating multiple vi environments

You can have several vi environments, each of which is different from the other. For example you might want a vi environment for writing C code and another for writing troff source files.

This is done by placing a different .exrc file in each directory that you use vi in. Each .exrc file contains set option commands to create the type of vi environment you want while editing files in this directory.


[Home] [Search] [Index]
didyou/vi.html100644 1032 165141 1440 6113364565 13163 0ustar laufersnobody Did You Know?

Did You Know?

The following topics are related to your present task. Select an item for more information about it.


[Home] [Search] [Index]
didyou/alias_csh.html100644 1032 165141 2305 6113364566 14475 0ustar laufersnobody Did You Know?

Did You Know?

The C shell assumes that that the arguments are always placed at the end of the command alias.

For example, you define an alias that gives members of your group access to a file or directory:

   alias ggive 'chmod g+'

Any argument that you give to the alias ggive is placed after the command it refers to. So the command alias

   ggive filename

is interpreted as:

   chmod g+ filename

[Home] [Search] [Index]
disclaimer.html100644 1032 165141 1456 6113364566 13374 0ustar laufersnobody Disclaimer

Computing Services
University of Edinburgh
JCMB
King's Buildings
Edinburgh EH9 3JZ


Disclaimer

This information is provided on an "as is" basis, with no guarantee of its veracity or accuracy. No liability is accepted for any damage caused by the use of this information.


[Home] [Search] [Index]
editors/ 40755 1032 165141 0 6113364567 11741 5ustar laufersnobodyeditors/whatisafile.html100644 1032 165141 2031 6113364566 15217 0ustar laufersnobody What is a file?

What is a file?

A file is a collection of letters, numbers and special characters: it may be a program, a database, a dissertation, a reading list, a simple letter etc.

Sometimes you may import a file from elsewhere, for example from another computer. If you want to enter your own text or data, you will start by creating a file.

Whether you copied a file from elsewhere or created your own, you will need to return to it later in order to edit its contents.


[Home] [Search] [Index]
editors/whatiseditor.html100644 1032 165141 1411 6113364566 15426 0ustar laufersnobody What is a text editor?

What is a text editor?

A text editor is a program for inserting or amending text in a file. A text editor is not a word processor although some text editors do include word processing facilities.


[Home] [Search] [Index]
editors/index.html100644 1032 165141 2072 6113364567 14034 0ustar laufersnobody Text editors

Text editors

While using UNIX you will often want to create a text file and then change its content in some way. A text editor is a program that has been designed especially for this purpose.


[Home] [Search] [Index]
emacs/ 40755 1032 165141 0 6113364576 11360 5ustar laufersnobodyemacs/commands.html100644 1032 165141 1703 6113364567 14145 0ustar laufersnobody Entering MicroEMACS commands

Entering MicroEMACS commands

To start using the 'toolkit' of editing instructions known collectively as MicroEMACS enter the command:

   ue

You are then placed 'in' MicroEMACS and use instructions that enable you to add, delete and manipulate text in the file.


[Home] [Search] [Index]
emacs/commands1.html100644 1032 165141 2703 6113364567 14227 0ustar laufersnobody Using MicroEMACS commands

Using MicroEMACS commands

You can type MicroEMACS instructions in upper or lower case. There are two types of instruction, CONTROL and META.

CONTROL instructions

These are typed while holding down the CTRL key which is signified by the ^ character. For example ^F is generated by pressing the F key while holding down the CTRL key.

META instructions

These are typed after pressing the ESC key which is signified by M-. For example, M-F is generated by pressing the ESC key and then typing the letter F. Throughout this document, the ESC key is referred to as the META key.

Remember, the CONTROL instructions are typed with the CTRL key and the META instructions are typed after the ESC key.

Sometimes a META or CONTROL instruction will prompt you for more information. This information may be another META or CONTROL instruction or some text.


[Home] [Search] [Index]
emacs/copy_blocks.html100644 1032 165141 2311 6113364567 14647 0ustar laufersnobody Copying a block of text

Copying a block of text

You can leave text in its present location and move a copy of it to a different location. This is useful when you have a special paragraph that you want to repeat in a number of locations.

To copy a block of text:

1. Define the 'region'.

2. Type the M-C instruction to 'copy' the 'region'.

3. Move the cursor to the place where you want the copied text to go.

4. Type ^Y to 'yank' the text.

A copy of the text moves from the 'kill' buffer and appears at its new location.


[Home] [Search] [Index]
emacs/del_blocks.html100644 1032 165141 1401 6113364567 14440 0ustar laufersnobody Deleting blocks of text

Deleting blocks of text

To delete a block of text:

1. Define the 'region'.

2. Type ^W to 'wipe' the 'region'.


[Home] [Search] [Index]
emacs/dyk_yank.html100644 1032 165141 1267 6113364570 14154 0ustar laufersnobody Did You Know?

Did You Know?

If you erase a 'region' by mistake, you can get it back if you immediately type the ^Y instruction.


[Home] [Search] [Index]
emacs/help.html100644 1032 165141 24172 6115614725 13315 0ustar laufersnobody MicroEMACS Quick Reference

MicroEMACS Quick Reference

=>              MicroEMACS 3.8 Help screens             (01/18/87)


M-  means to use the <ESC> key prior to using another key
^A  means to use the control key at the same time as the A key


^V or [Pg Dn]     Scroll down           M-< or <HOME>   Beginning of file
^Z or [Pg Up]     Scroll up             M-> or <END>    End of file


-----------------------------------------------------------------------------

=>              (1) MOVING THE CURSOR


^F  Forward character   M-F    Forward word             Keypad arrows
^B  Backward character  M-B    Backward word            are active!
^A  Front of line       M-G    Goto a line
^E  End of line
^N  Next line           M-N    Front of paragraph
^P  Previous line       M-P    End of paragraph

-----------------------------------------------------------------------------

=>              (2) DELETING & INSERTING


<--             Delete previous character
^D or <DELETE>  Delete next character
^C or <INSERT>  Insert a space
M-<--           Delete previous word
M-D             Delete next word
^K              Close (delete) to end of line

-----------------------------------------------------------------------------

=>              (2a) MORE DELETING & INSERTING


<RETURN>   Insert a newline             <TAB>  Advance to next tab stop
^J         Insert a newline and indent  M-^W   Delete paragraph
^O         Open (insert) line
^W         Delete region between mark (set using M-<spacebar>) and cursor
M-W        Copy region to kill buffer
^X ^O      Delete blank lines around cursor

-----------------------------------------------------------------------------

=>              (3) SEARCHING


^S      Search forward from cursor position.
^R      Reverse search from cursor position.
^X S    Forward incremental search
^X R    Reverse incremental search
<ALT> S Search for the next occurence of the last string (IBM-PC only)
<ALT> R Search for the last occurence of the last string (IBM-PC only)

-----------------------------------------------------------------------------

=>              (4) REPLACING


M-R   Replace all instances of first typed-in string with second
typed-in string.  End each string with ESC.
M-^R  Replace with query.  Answer with:
^G  cancel                      .   exit to entry point
!   replace the rest            Y    replace & continue
?   Get a list of options       N   no replacement & continue

-----------------------------------------------------------------------------

=>              (5) CAPITALIZING & TRANSPOSING


M-U     UPPERCASE word
M-C     Capitalize word         ^T      Transpose characters
M-L     lowercase word
^X ^L   lowercase region
^X ^U   uppercase region
^Q      Quote next entry, so that control codes may be entered into text

-----------------------------------------------------------------------------

=>              (6) REGIONS & THE KILL BUFFER


M-<spacebar>    set MARK at current position
^X ^X           eXchange mark and cursor


A REGION will then be continuously-defined as the area between the mark and
the current cursor position.  The KILL BUFFER is the text which has been
most recently saved or deleted.

-----------------------------------------------------------------------------

=>              (7) COPYING AND MOVING


^W  Delete (Wipe) region                M-W     copy region to KILL buffer
^Y  Yankback save buffer at cursor
Generally, the procedure for copying or moving text is:
1)  Mark a REGION using M-<spacebar> at beginning and cursor at end.
2)  Delete it (with ^W) or copy it (with M-W) into the KILL buffer.
3)  Move the cursor to the desired location and yank it back (with ^Y).

-----------------------------------------------------------------------------

=>              (8) MODES OF OPERATION


^X M    Add mode in buffer              M-M    Add global mode
^X ^M   Delete mode in buffer           M-^M   Delete global mode
OVER            Replaces (overwrites) rather than inserts characters
WRAP            Turns on word wrap (automatic carraige return).
VIEW            Allows viewing file without insertion and deletion.
CMODE           Automatic indenting for C program entry
ASAVE           Automatic saving of current buffer
EXACT/MAGIC     Changes how search and replace commands work (see next page)

-----------------------------------------------------------------------------

=>              (9) SEARCH AND REPLACE MODES


EXACT   Upper/lower case is not ignored in searches
MAGIC   Regular pattern matching characters are active
.   Matches any one character
*   Matches any any number of the preceding character
^   Beginning of line        [ ]   Character class enclosure
$   End of line              \     Quote next character

-----------------------------------------------------------------------------

=>              (10) ON-SCREEN FORMATTING


^X F            Set fill column
Mn-<tab>        Set tab spacing to n charecters between tabs stops
M-Q             Format paragraph so that text lies between margins
^X =            Position report -- displays line number, char count,
file size and character under cursor
M-^C            Count words/lines/chars in marked region

-----------------------------------------------------------------------------

=>              (11) MULTIPLE WINDOWS


Many WINDOWS may be active at once on the screen.  All windows may show
different parts of the same buffer, or each may display a different one.
^X 2    Split the current window in two ^X O    Change to next window
^X 0    delete current window           ^X P    Change to previous window
^X 1    delete all other windows        M-^V    Page down next window
M-^Z    Page up other window

-----------------------------------------------------------------------------

=>              (12) CONTROLLING WINDOWS AND THE SCREEN


^X ^    Enlarge current window   M-<n> ^X W   Resize window to <n> lines
^X ^Z   Shrink current window    M-<n> M-S    Change screen to <n> lines
^X ^N   Move window down         M-<n> M-T    Change screen to <n> columns
^X ^P   Move window up
M-^L    Reposition window
^L      Refresh the screen

-----------------------------------------------------------------------------

=>              (13) MULTIPLE BUFFERS


A BUFFER is a named area containing a document being edited.  Many buffers
may be activated at once.
^X B    Switch to another buffer.  <CR> = use just-previous buffer
^X X    Switch to next buffer in buffer list
M-^N    Change name of current buffer
^X K    Delete a non-displayed buffer.
^X ^B   Display buffer directory in a window

-----------------------------------------------------------------------------

=>              (14) READING FROM DISK


^X ^F   Find file; read into a new buffer created from filename.
(This is the usual way to begin editing a new file.)
^X ^R   Read file into current buffer, erasing its previous contents.
No new buffer will be created.
^X ^I   Insert file into current buffer at cursor's location.
^X ^V   Find a file to make current in VIEW mode

-----------------------------------------------------------------------------

=>              (15) SAVING TO DISK


^X ^S   Save current buffer to disk
or
M-^\    Save current buffer to disk
^X ^W   Write current buffer to disk
^X N    Change file name of current buffer
M-Z     Write out all changed buffers and exit MicroEMACS



-----------------------------------------------------------------------------

=>              (16) ACCESSING THE OPERATING SYSTEM


^X !    Send one command to the operating system and return
^X @@    Pipe DOS command results to buffer
^X #    Filter buffer through DOS filter program
^X C    Start a new command processor under MicroEMACS
^X D    Suspend MicroEMACS into the background (UNIX BSD4.2 only)
^X ^C   Exit MicroEMACS

-----------------------------------------------------------------------------

=>              (17) KEY BINDINGS AND COMMANDS


M-K     Bind a key to a command        M-A  Describe a class of commands
M-^K    Unbind a key from a command
^X ?    Describe command bound to a key
M-X     Execute a named (and possibly unbound) command
{Describe-bindings}
Display a list of all commands and key bindings to a buffer

-----------------------------------------------------------------------------

=>              (18) COMMAND EXECUTION


Commands can be specified as command lines in the form:
<optional repeat count> {command-name} <optional arguments>
{Execute-command-line}  execute a typed in command line
{Execute-buffer}        executes commands lines in a buffer
{Execute-file}          executes command lines from a file
{clear-message-line}    clears the message line during execution
M-~                  clears the change flag for a buffer

-----------------------------------------------------------------------------

=>              (19) MACRO EXECUTION


^X (    Start recording keyboard macro
^X )    Stop recording keyboard macro
^X E    Execute keyboard macro
M-<n> {store-macro}     Start recording named macro
!endm             Stop recording named macro
{execute-macro-n}       Execute macro n (where n is from 1 to 20)

-----------------------------------------------------------------------------

=>              (20) SPECIAL KEYS


^G              Cancel current command and return to top level of processing.
^U or           Universal repeat.  May be followed by an integer (default = 4)
M-<digit>       and repeats the next command that many times.
M-X             Execute a named (and possibly unbound) command


[Home] [Search] [Index]
emacs/index.html100644 1032 165141 2633 6113364570 13450 0ustar laufersnobody MicroEMACS: User Guide

MicroEMACS: User Guide

This Guide describes how to get started with MicroEMACS. For details on how to perform more complicated functions consult the MicroEMACS Reference Manual or read the manual page.


[Home] [Search] [Index]
emacs/moving.html100644 1032 165141 1552 6113364570 13637 0ustar laufersnobody Moving round the text

Moving round the text

Here are the MicroEMACS instructions for moving round a file.


[Home] [Search] [Index]
emacs/opening_tip.html100644 1032 165141 1462 6113364571 14654 0ustar laufersnobody Tip: Editing an existing file

Tip: Editing an existing file

Before opening an important file for editing, it is good practice to make a copy of your original file; in the event of problems you can always revert to the original.


[Home] [Search] [Index]
emacs/replace.html100644 1032 165141 1567 6113364571 13762 0ustar laufersnobody Replacing text

Replacing text

The next step from an instruction which asks 'Find me this text', is one which asks 'Find me this text and replace it with that text'.


[Home] [Search] [Index]
emacs/replace_global.html100644 1032 165141 2344 6115614754 15277 0ustar laufersnobody Global replace

Global replace

To replace every occurrence of a piece of text from the cursor to the end of the file:

1. Type M-R.

   Replace []<META>:

2. Type in the text you want to replace and press the META key.

You will then be prompted for the new text, with a prompt like this:

   with []<META>:

3. Type in the new text and press the META key

All the occurrences of the old text will be replaced by the new and the number of changes printed at the bottom of your screen, for example:

   36 substitutions

[Home] [Search] [Index]
emacs/replace_query.html100644 1032 165141 3342 6115615007 15173 0ustar laufersnobody Query replace

Query replace

This is like Global Replace, but instead of replacing every occurrence, it stops at each one and asks whether you want to replace it or move to the next occurence.

1. Type M-^R

You are first prompted for the text you want to replace. The prompt will look like this:

   Query replace []<META>:

2. Type in the text you want to replace and press the META key.

You will then be prompted for the text you want to insert. The prompt will look like this:

   with []<META>:

3. Type in the text you want to insert and press the META key.

The cursor will move to each occurrence of the text you want to replace. Each time you will be given a prompt like this:

   Replace 'junk' with 'test'?

4. Type in one of the options:

    y  (yes, do this replace)

    n  (no, don't do this replace)

    !  (Do replaces without asking)

    ^G (stop now)

[Home] [Search] [Index]
emacs/rpt_search.html100644 1032 165141 1467 6113364572 14501 0ustar laufersnobody To repeat a search

To repeat a search

1. Give the search instruction (forward or reverse)

2. Press the META key. You can repeat this procedure all through the file.


[Home] [Search] [Index]
emacs/search_back.html100644 1032 165141 2121 6115615042 14551 0ustar laufersnobody Search backwards

Search backwards

The search backward instruction searches for text from the cursor to the end of the file. If you want to search the whole file move to the end of the file first.

To search backwards:

1. Type ^R

You will be prompted for the string you want to look for. The prompt will look like:

   Reverse Search []<META>:

2. Type in the text you want to search for followed by the META character.


[Home] [Search] [Index]
emacs/search_for.html100644 1032 165141 2075 6115615067 14456 0ustar laufersnobody Search forward

Search forward

The search forward instruction searches for text from the cursor to the end of the file. If you want to search the whole file move to the start of the file first.

To search forward:

1. Type ^\

You will be prompted for the string you want to look for. The prompt will look like:

   Search []<META>:

2. Type in the text you want to search for then press the META key.


[Home] [Search] [Index]
emacs/searching.html100644 1032 165141 1614 6113364572 14304 0ustar laufersnobody Searching for text

Searching for text

MicroEMACS provides searching instructions which enable you to move straight to specific text.


[Home] [Search] [Index]
emacs/ue_along.html100644 1032 165141 2034 6113364572 14127 0ustar laufersnobody Move along a line

Move along a line

To...                                   Do this...


Move cursor to next character ^F Move cursor to previous character ^B Move cursor to next word M-F Move cursor to previous word M-B Move cursor to start of line ^A Move cursor to end of line ^E

[Home] [Search] [Index]
emacs/ue_between.html100644 1032 165141 1454 6113364573 14466 0ustar laufersnobody Moving between lines

Moving between lines

To...                                   Do this...


Move cursor to next line ^N Move cursor to previous line ^P

[Home] [Search] [Index]
emacs/ue_create.html100644 1032 165141 1703 6113364573 14275 0ustar laufersnobody Creating a new file

Creating a new file

To create a new file you first need to choose a name for it. It is best to give it a name which is meaningful to you, for example, if you are writing a letter call the file letter.

You can create a new file in two ways:


[Home] [Search] [Index]
emacs/ue_delete.html100644 1032 165141 2157 6113364573 14300 0ustar laufersnobody Deleting text

Deleting text

To...                           Do this..


Delete the character to Press the DELETE key. the left of the cursor. Delete the character under ^D the cursor. Delete from cursor to the M-D end of a word. Delete from cursor to the M-^H start of a word. Delete from cursor to the ^K end of a line. Delete an entire line. ^A^K Undelete (yank back) a ^Y word or line.

[Home] [Search] [Index]
emacs/ue_def_region.html100644 1032 165141 2104 6113364573 15127 0ustar laufersnobody To define the 'region'

To define the 'region'

1. Move the cursor to the start of the text block you want to define.

2. Type M-space (the META character followed by a space).

This sets a 'mark' at the start of the 'region'.

3. Move the cursor to the end of the text block you want to define as the 'region'.

This sets the 'point' at the end of the 'region'. You do not have to type anything to set this 'point', the 'point' is the location of the cursor.


[Home] [Search] [Index]
emacs/ue_enter.html100644 1032 165141 1752 6113364573 14153 0ustar laufersnobody Entering text

Entering text

When you start MicroEMACS, the cursor will be at the top left hand corner of your terminal screen. Any text you now type at your keyboard will be placed before this cursor. This means the cursor will move to the right each time you type in a character.

When you are typing in text and you reach the end of the line, the cursor will move to the start of the next line of your screen. This is known as 'word wrap'.


[Home] [Search] [Index]
emacs/ue_lv_nosave.html100644 1032 165141 1620 6113364573 15024 0ustar laufersnobody Leaving a file without saving changes

Leaving a file without saving changes

It is very useful to be able to abandon a file without saving any of the changes you have made since the last time you saved it. To do this type ^X^C.

This asks if you want to leave without saving the changes, to which you should reply Y.


[Home] [Search] [Index]
emacs/ue_mving.html100644 1032 165141 2133 6113364574 14151 0ustar laufersnobody Moving, Copying and Deleting blocks of text

Moving, Copying and Deleting blocks of text

A block of text is referred to in MicroEMACS as a 'region'. It is defined by the position of a special 'mark' at one end, and by the cursor (referred to as the 'point') at the other.

This section explains how you can:


[Home] [Search] [Index]
emacs/ue_mving_block.html100644 1032 165141 2432 6113364574 15325 0ustar laufersnobody Moving a block of text

Moving a block of text

Moving text amounts to picking up words and placing them in a new position.

To move a block of text do the following:

1. Define the 'region'.

2. Type ^W to 'wipe' the 'region'.

3. Move the cursor to the place where you want the text to go.

4. Type ^Y to 'yank' the text.

A copy of the text moves from the 'kill buffer' and appears in its new location. The text remains in this buffer until it is replaced by something else or until you finish using MicroEMACS. As long as the text is in this buffer you can continue inserting it into different places.


[Home] [Search] [Index]
emacs/ue_opening.html100644 1032 165141 1640 6113364574 14472 0ustar laufersnobody Opening an existing file

Opening an existing file

You may want to open an existing file to change its contents. To do this type:

   ue filename

So to open the file called letter you would type:

   ue letter

[Home] [Search] [Index]
emacs/ue_over.html100644 1032 165141 1461 6115615112 13774 0ustar laufersnobody Moving over the file

Moving over the file

To...                                   Do this...


Move cursor to the top of the file M-< Move to the bottom of the file M->

[Home] [Search] [Index]
emacs/ue_saving.html100644 1032 165141 1627 6113364574 14327 0ustar laufersnobody Saving and closing files

Saving and closing files

You can save a file in several ways.


[Home] [Search] [Index]
emacs/ue_screens.html100644 1032 165141 1461 6113364574 14476 0ustar laufersnobody Moving between screens

Moving between screens

To...                                   Do this...


Move to next screen ^V Move to previous screen ^Z

[Home] [Search] [Index]
emacs/ue_sv_continue.html100644 1032 165141 1444 6113364575 15372 0ustar laufersnobody Save and continue editing

Save and continue editing

You should save your work periodically - say every ten minutes or so. To save your work but remain within MicroEMACS so that you can continue editing, type the instruction M-^\.


[Home] [Search] [Index]
emacs/ue_sv_leave.html100644 1032 165141 1276 6113364575 14645 0ustar laufersnobody Save and leave the file

Save and leave the file

To finish editing, save the file and exit from MicroEMACS type the instruction M-Z.


[Home] [Search] [Index]
emacs/ue_sv_new.html100644 1032 165141 1646 6113364575 14343 0ustar laufersnobody Saving to a new file

Saving to a new file

To write to a new file type ^X^W and give the name of a file in answer to the Write File: prompt.

Any subsequent editing you do will affect this new file. The old file will be left as it was when you last saved it.

**Caution**

If the file you specify already exists, its contents will be overwritten.


[Home] [Search] [Index]
emacs/ue_using.html100644 1032 165141 2770 6113364575 14166 0ustar laufersnobody Creating a file using a filename

Creating a file using a filename

Type

   ue filename

to create a new file. For instance, to create a new file called letter, type:

   ue letter

The screen of your terminal will fill with blank lines and the following message will be displayed at the bottom:

== MicroEMACS 3.9e() == letter == File: letter ========

This consists of:

  1. the name MicroEMACS and the version number
  2. the editing mode you are in (this changes as you change modes)
  3. the name of the temporary work file used to store the file you are editing (the computer term for this is 'buffer')
  4. the name of the file that text will be written to

The bottom line of your screen is used for messages from ue and for prompting you for information which you may need to type.


[Home] [Search] [Index]
emacs/ue_view.html100644 1032 165141 2026 6113364575 14005 0ustar laufersnobody Viewing a file

Viewing a file

You can look at a file without altering its contents by running MicroEMACS in view mode. Use this mode when you want to check the contents of a file or to look at a file which belongs to another user. To do this use the -v option.

To look at the file letter you would type:

   ue -v letter

Notice that the status line contains the word VIEW. This tells you that you are in view mode.


[Home] [Search] [Index]
emacs/ue_without.html100644 1032 165141 2033 6113364575 14534 0ustar laufersnobody Creating a file without using a filename

Creating a file without using a filename

Type

   ue

without a filename. This starts MicroEMACS without a file.

The screen of your terminal will fill with blank lines and the following message will be displayed at the bottom:

== MicroEMACS 3.9e() == main =======================

Remember to save to a new file if you create a file in this way.


[Home] [Search] [Index]
emacs/cancel_tip.html100644 1032 165141 1215 6113364576 14443 0ustar laufersnobody Searching: Tip...

Searching: Tip...

Type ^G to cancel a search or replace dialogue.


[Home] [Search] [Index]
environment/ 40755 1032 165141 0 6113364607 12627 5ustar laufersnobodyenvironment/bash1.html100644 1032 165141 2043 6113364576 14614 0ustar laufersnobody Display current working directory

Display current working directory

To display your current working directory in the prompt:

1. Use your editor to open your .bashrc file and add the line:

   PS1='\W $'

2. Save the file and leave the editor.

3. Enter the command:

   . bashrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/bash2.html100644 1032 165141 2022 6113364576 14612 0ustar laufersnobody Display username

Display username

To display your username in the prompt:

1. Use your editor to open your shell start-up file and add the line:

   PS1='$USER $'

2. Save the file and leave the editor.

3. Enter the command:

   . .bashrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/bash3.html100644 1032 165141 1771 6113364576 14625 0ustar laufersnobody Display system name

Display system name

To display the name of the system in the prompt:

1. Use your editor to open your .bashrc file and add the line:

   PS1='$HOST $'

2. Save the file and leave the editor.

3. Enter the command:

   . .bashrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/csh.html100644 1032 165141 1515 6113364577 14377 0ustar laufersnobody Setting the prompt variable: C shell

Setting the prompt variable: C shell

Select an item for more information.


[Home] [Search] [Index]
environment/csh1.html100644 1032 165141 2035 6113364577 14456 0ustar laufersnobody Display current working directory

Display current working directory

To display your current working directory in the prompt:

1. Use your editor to open your .cshrc file and add the line:

   set prompt = "$cwd:t %"

2. Save the file and leave the editor.

3. Enter the command:

   source .cshrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/csh2.html100644 1032 165141 1774 6113364577 14470 0ustar laufersnobody Display username

Display username

To display your username in the prompt:

1. Use your editor to open your .cshrc and add the line:

   set prompt = "$LOGNAME %"

2. Save the file and leave the editor.

3. Enter the command:

   source .cshrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/csh3.html100644 1032 165141 1777 6113364577 14474 0ustar laufersnobody Display system name

Display system name

To display the name of the system in the prompt:

1. Use your editor to open your .cshrc file and add the line:

   set prompt="%m %"

2. Save the file and leave the editor.

3. Enter the command:

   source .cshrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/csh_exmp.html100644 1032 165141 1503 6113364577 15425 0ustar laufersnobody Examples of changing shell variables

Examples of changing shell variables

Look at these examples of how local C and TC shell variables can be used.


[Home] [Search] [Index]
environment/csh_tip.html100644 1032 165141 2620 6113364577 15251 0ustar laufersnobody C Shell: Tip...

C Shell: Tip...

If a shell and an environment variable have the same name, the value of the local shell variable will be used. You can avoid problems by making sure that shell and environment variables with the same name are set to the same value in your .cshrc (.tcshrc).

For example, suppose you set the following variables in this order in your .cshrc (.tcshrc) file:

   setenv TERM vt100
   ...
   ...
   set term=xterm

When a shell is invoked, the value of the environment variable TERM is copied into the shell variable term. But the value of this shell variable is set later on in the .cshrc (.tcshrc) file, and it is this value which is then copied back into the environment value TERM which is then exported to the general environment.


[Home] [Search] [Index]
environment/env2.1.html100644 1032 165141 3163 6113364600 14617 0ustar laufersnobody Examples of showing the value of variables

Examples of showing the value of variables

In the C and TC shell, to show the values of all your environment variables:

   printenv
   TERM=vt100
   HOME=/home/eucs/helper
   SHELL=/usr/local/bin/Tcsh
   USER=helper
   TZ=GMT0BST
   UCBPATH=:/usr/ucb:/bin:/usr/bin
   ATTPATH=:/bin:/usr/bin
   UCBSHELL=/usr/local/bin/Tcsh
   ATTSHELL=/bin/sh
   LOGNAME=helper
   MAIL=/home/eucs/helper/.mail

This shows that this user's terminal type is set to VT100, that they use the TC shell and that they are on Greenwich Mean Time.


In the Bourne, BASH and Korn shell, to show the value of all your variables:

   set
   BASH=/usr/local/utils/bin/bash
   BASH_VERSION=1.12.1
   DELIVERY=John Smith Room 2004 JCMB
   DISPLAY=frolix8.ucs:0
   EDITOR=ue
   FOLDERS=/home/eucs/erpl08/Mail
   HISTFILE=/home/eucs/erpl08/.bash_history
   HISTFILESIZE=50
   HISTSIZE=100
   HOME=/home/eucs/erpl08

...

This shows the value of an assorted range of variables.


[Home] [Search] [Index]
environment/env2.html100644 1032 165141 3603 6113364600 14457 0ustar laufersnobody Displaying current variables

Displaying current variables

You can use the echo command to display the value of an environment variable. For example:

   echo $PATH

This displays the value of the environment variable PATH. The name of an environment variable is given in UPPER CASE.

The $ sign is a shell metacharacter that uses the value of the variable instead of its name.

The method for displaying the value of every variable varies according to which shell you are using.

For the Bourne shell use the command set to display the value of environment variables.

For the C and TC shell use the command printenv or env to display the value of environment variables and the command set to display the value of local shell variables.

If the list of variables is so long that it scrolls off the screen and you want to display the information one screenful at a time, pipe the output through a pager. For example:

   set | more

[Home] [Search] [Index]
environment/env3a.html100644 1032 165141 2307 6113364600 14621 0ustar laufersnobody Changing your environment: Bourne shell

Changing your environment: Bourne shell

At login the Bourne shell reads the initialisation files /etc/profile and $HOME/.profile. You cannot change the content of /etc/profile, but you have permission to edit the contents of .profile, which is in your home directory and is owned by you.


[Home] [Search] [Index]
environment/env3aa.html100644 1032 165141 2053 6113364600 14760 0ustar laufersnobody Making a temporary change

Making a temporary change

To make a temporary change to the value of an environment variable enter the command:

   $ VARNAME=value_of_variable

This value will remain until you logout from the system or exit from the shell you are working in.

To make other programs that use the variable aware of the new value enter the command:

   $ export VARNAME

[Home] [Search] [Index]
environment/env3ab.html100644 1032 165141 2112 6113364600 14755 0ustar laufersnobody Making lasting changes

Making lasting changes

To make lasting changes to the value of an environment variable:

1. Use your editor to open the .profile file and add the line:

   VARNAME=value_of_variable;export VARNAME

2. Save the file and leave the editor.

3. Enter the command:

   . .profile

This adds the new value to your working environment.


[Home] [Search] [Index]
environment/env3b.html100644 1032 165141 2747 6113364600 14632 0ustar laufersnobody Changing your environment: C and TC shells

Changing your environment: C and TC shells

At login the C (and TC shell) reads initialisation files in your home directory. First it reads the file .cshrc (.tcshrc for TC shell) followed by the file .login.

In addition to environmental variables, both these shells have a number of local shell variables which are not exported to the environment.

When another shell is created to run a program, it only reads the .cshrc (.tcshrc) file, but it inherits any environment variables that were set up at login.


[Home] [Search] [Index]
environment/env3ba.html100644 1032 165141 3015 6113364600 14760 0ustar laufersnobody Changing environment variables

Changing environment variables

To make a temporary change to the value of an environment variable enter the command:

   setenv VARNAME value_of_variable

This value will remain until you logout from the system or exit from the shell you are working in. By convention, the names of environment variables are given in UPPER CASE.

To make lasting changes to the value of an environment variable:

1. Use your editor to open the .cshrc (.tcshrc) and add the line:

   setenv VARNAME value_of_variable

2. Save the file and leave the editor.

3. Enter the command:

   source .cshrc (.tcshrc)

This adds the new value for the variable to your environment.


[Home] [Search] [Index]
environment/env3c.html100644 1032 165141 2040 6113364601 14616 0ustar laufersnobody Setting environment variables: Korn shell

Setting environment variables: Korn shell

To change an environment variable use the command:

   VARNAME=value of variable

By convention, the variable name is given in upper case.


[Home] [Search] [Index]
environment/env3ca.html100644 1032 165141 2073 6113364601 14765 0ustar laufersnobody Making a temporary change

Making a temporary change

To make a temporary change the value of an environment variable enter the command:

   VARNAME=value_of_variable

This value will remain until you logout from the system or exit from the shell you are working in.

To make other programs that use the variable aware of the new value enter the command:

   export VARNAME

[Home] [Search] [Index]
environment/env3cb.html100644 1032 165141 2165 6113364601 14770 0ustar laufersnobody Making lasting changes

Making lasting changes

To make lasting changes to the value of an environment variable:

1. Use your editor to open the .profile file and add the line:

   VARNAME=value_of_variable;export VARNAME

2. Save the file and leave the editor.

3. Enter the command:

   . .profile

This adds the new value to your working environment.


[Home] [Search] [Index]
environment/env3d.html100644 1032 165141 2042 6113364601 14621 0ustar laufersnobody Setting environment variables: BASH shell

Setting environment variables: BASH shell

To change an environment variable use the command:

   VARNAME=value of variable

By convention, the variable name is given in upper case.


[Home] [Search] [Index]
environment/env3da.html100644 1032 165141 2074 6113364602 14770 0ustar laufersnobody Making a temporary change

Making a temporary change

To make a temporary change the value of an environment variable enter the command:

   VARNAME=value_of_variable

This value will remain until you logout from the system or exit from the shell you are working in.

To make other programs that use the variable aware of the new value enter the command:

   export VARNAME

[Home] [Search] [Index]
environment/env3db.html100644 1032 165141 2213 6113364602 14764 0ustar laufersnobody Making lasting changes

Making lasting changes

To make lasting changes to the value of an environment variable:

1. Use your editor to open the .bash_profile file and add the line:

   VARNAME=value_of_variable;export VARNAME

2. Save the file and leave the editor.

3. Enter the command:

   source $HOME/.bash_profile

This adds the new value to your working environment.


[Home] [Search] [Index]
environment/env5.html100644 1032 165141 2421 6113364602 14461 0ustar laufersnobody Changing shell variables

Changing shell variables

The C and TC shells have a number of local shell variables which are not exported to the environment. To make sure that these variables are picked up whenever a new shell is invoked, always define shell variables in your .cshrc (.tcshrc) file.

By convention, names of shell variables are always given in lower case letters. UNIX is case sensitive, so the environment variable PATH is not the same as the shell variable "path".


[Home] [Search] [Index]
environment/env6.html100644 1032 165141 2575 6113364602 14474 0ustar laufersnobody Finding out which shell you are using

Finding out which shell you are using

Information about which shell you are using is held in the SHELL environment variable. The command

   echo $SHELL

displays the value of this variable.

You can identify which shell you are presently using from the last part of the pathname.

Pathname                Shell
__________________________________________________________

/.../sh                 Bourne shell
/.../csh                C shell
/.../tcsh               TC shell
/.../ksh                Korn shell
/.../bash               Bourne Again SHell
__________________________________________________________

[Home] [Search] [Index]
environment/env7.html100644 1032 165141 2250 6113364603 14464 0ustar laufersnobody Safeguarding your files

Safeguarding your files

It's easy to overwrite (clobber) existing files when you are redirecting output to a file. To prevent this from happening you need to set the noclobber shell variable by adding a line to your shell start-up file.

Depending on which shell you are using this is:

C shell
set noclobber
TC shell
set noclobber
Korn shell
set -o noclobber
BASH
set noclobber

[Home] [Search] [Index]
environment/env8.html100644 1032 165141 2053 6113364603 14466 0ustar laufersnobody Setting the prompt variable

Setting the prompt variable

You can customise the prompt so that it displays your current working directory, username on the system and the name of the system; or any combination of these.

How this is done varies according to the shell you are using.


[Home] [Search] [Index]
environment/exmp_bash.html100644 1032 165141 3227 6113364603 15560 0ustar laufersnobody Examples of changing environment variables: BASH shell

Examples of changing environment variables: BASH shell

To change to using another printer for the current login session:

   PRINTER=ps2

Whenever the user prints a file, the output will be sent to the printer ps2.


To change to using another editor for the current login session and inform (export) this value to other programs which use it:

   EDITOR=vi
   export EDITOR

This changes the user's default editor to vi and exports this value to other programs - such as electronic mail - which make use of it.


To change to using another pager for viewing files the user adds the following lines to their.profile file.

   PAGER=less;export PAGER

To make this change take immediate effect enter the command:

   source .bash_profile

This causes the .bash-profile file to be read, setting the variables to their new values.


[Home] [Search] [Index]
environment/exmp_csh.html100644 1032 165141 3214 6113364603 15414 0ustar laufersnobody Examples of changing environment variables: C and TC shell

Examples of changing environment variables: C and TC shell

To change to using another printer for the current login session:

   setenv PRINTER ps2

Whenever the user prints a file, the output will be sent to the printer ps2.


To change to using another editor for the current login session and inform (export) this value to other programs which use it:

   setenv EDITOR vi

This changes the user's default editor to vi and exports this value to other programs - such as electronic mail - which make use of it.


To change to using another pager for viewing files the user adds the following lines to their .cshrc (.tcshrc) file.

   setenv PAGER less

To make this change take immediate effect enter the command:

   source $HOME/.cshrc

This causes the .cshrc file to be read, setting the variables to their new values.


[Home] [Search] [Index]
environment/exmp_ksh.html100644 1032 165141 3207 6113364604 15427 0ustar laufersnobody Examples of changing environment variables: Korn shell

Examples of changing environment variables: Korn shell

To change to using another printer for the current login session:

   PRINTER=ps2

Whenever the user prints a file, the output will be sent to the printer ps2.


To change to using another editor for the current login session and inform (export) this value to other programs which use it:

   EDITOR=vi
   export EDITOR

This changes the user's default editor to vi and exports this value to other programs - such as electronic mail - which make use of it.


To change to using another pager for viewing files the user adds the following lines to their.profile file.

   PAGER=less;export PAGER

To make this change take immediate effect enter the command:

   . .profile

This causes the .profile file to be read, setting the variables to their new values.


[Home] [Search] [Index]
environment/index.html100644 1032 165141 2674 6113364604 14727 0ustar laufersnobody Managing your Environment

Managing your Environment

Your working environment is defined whenever you login or start another shell. This environment is set using the values that the shell finds in initialisation files which it always reads as it starts up.

You can change your working environment by editing these files and setting new values for variables. Each shell handles its initialisation files in a different way; select one of the headings below for the shell that you use.


[Home] [Search] [Index]
environment/ksh.html100644 1032 165141 1523 6113364605 14376 0ustar laufersnobody Setting the prompt variable: Korn shell

Setting the prompt variable: Korn shell

Select an item for more information.


[Home] [Search] [Index]
environment/ksh1.html100644 1032 165141 2027 6113364605 14457 0ustar laufersnobody Display current working directory

Display current working directory

To display your current working directory in the prompt:

1. Use your editor to open your .kshrc file and add the line:

   PS1='${PWD##*/} $'

2. Save the file and leave the editor.

3. Enter the command:

   . .kshrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/ksh2.html100644 1032 165141 1733 6113364605 14463 0ustar laufersnobody Display username

Display username

To display your username in the prompt:

1. Use your editor to open your .kshrc and add the line:

   PS1='$USER $'

2. Save the file and leave the editor.

3. Enter the command:

   . .profile

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/ksh3.html100644 1032 165141 1755 6113364605 14470 0ustar laufersnobody Display system name

Display system name

To display the name of the system in the prompt:

1. Use your editor to open your .kshrc file and add the line:

   PS1='$HOST $'

2. Save the file and leave the editor.

3. Enter the command:

   . .kshrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/more_csh.html100644 1032 165141 3241 6113364605 15407 0ustar laufersnobody More on environment variables in csh/tcsh

More on environment variables in csh/tcsh

This complicated procedure is designed to allow the the login shell to be set up to behave differently to subsequent shells. And since environment variables only need to be initialised once at login, the behaviour of other shells can be changed by setting shell variables in .cshrc which is read each time a new shell is invoked.

Usually, you are are advised to set environment variables in your .login file and shell variables in your .cshrc. This arrangement prevents your environment being re-initialised every time a shell is started.

If you use a network windowing systems such as X, it is likely that you may start up a shell on a remote host which is not a login shell. If this is the case, any environment variables set in your .login on that host will not become part of your environment.

Puzzled? Don't be. The simplest solution is to set both environment and shell variables in your .cshrc or (.tcshrc) file.


[Home] [Search] [Index]
environment/sh.html100644 1032 165141 3144 6113364606 14225 0ustar laufersnobody Examples of changing environment variables: Bourne shell

Examples of changing environment variables: Bourne shell

To change to using another printer for the current login session:

   PRINTER=ps2

Whenever the user prints a file, the output will be sent to the printer ps2.


To change to using another editor for the current login session and inform (export) this value to other programs which use it:

   EDITOR=vi
   export EDITOR

This changes the user's default editor to vi and exports this value to other programs - such as electronic mail - which make use of it.


To change to using another pager for viewing files the user adds the following lines to their .profile file.

   PAGER=less;export PAGER

To make this change take immediate effect enter the command:

   . .profile

This causes the .profile file to be read, setting the variables to their new values.


[Home] [Search] [Index]
environment/sh_tip.html100644 1032 165141 2336 6113364606 15103 0ustar laufersnobody Shell Startup Tip

Shell Startup Tip

Make a copy of your shell start up file before editing it to change environment or shell variables.

You can always return to using this copy if you find that the modified file is not working and you are unable to fix the problem. For example:

   cd
   cp .profile old_profile
   ue .profile

The first command changes you to your home directory, where a copy of the file .profile is made in old_profile. You can then edit the .profile.

To revert to using the original .profile you simply copy it back. For example:

   cp old_profile .profile

[Home] [Search] [Index]
environment/sh_var.html100644 1032 165141 3004 6113364606 15070 0ustar laufersnobody Setting shell variables

Setting shell variables

To define a temporary value to a shell variable use the command:

   set variable_name=value

The value of this variable will remain set until you exit from this shell. The value of this variable is not exported to other C shells when they are invoked.

To give a lasting value to a shell variable:

1. Use an editor to open your .cshrc (.tcshrc) file and add the line:

   set variable_name=value

2. Save the file and leave the editor.

3. Enter the command:

   source .cshrc

This adds the value of the shell variable to your shell's present environment. When other C shells are invoked they will also have this variable set.


[Home] [Search] [Index]
environment/tcsh.html100644 1032 165141 1522 6113364606 14552 0ustar laufersnobody Setting the prompt variable: TC shell

Setting the prompt variable: TC shell

Select an item for more information.


[Home] [Search] [Index]
environment/tcsh1.html100644 1032 165141 2030 6113364607 14627 0ustar laufersnobody Display current working directory

Display current working directory

To display your current working directory in the prompt:

1. Use your editor to open your .tcshrc and add the line:

   set prompt='%. %'

2. Save the file and leave the editor.

3. Enter the command:

   source .tcshrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/tcsh2.html100644 1032 165141 1754 6113364607 14644 0ustar laufersnobody Display username

Display username

To display your username in the prompt:

1. Use your editor to open your .tcshrc and add the line:

   set prompt = "${user} %"

2. Save the file and leave the editor.

3. Enter the command:

   source .tcshrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/tcsh3.html100644 1032 165141 1771 6113364607 14644 0ustar laufersnobody Display system name

Display system name

To display the name of the system in the prompt:

1. Use your editor to open your .tcshrc file and add the line:

   set prompt='%m %'

2. Save the file and leave the editor.

3. Enter the command:

   source .tcshrc

This adds the new values to your working environment.


[Home] [Search] [Index]
environment/bash.html100644 1032 165141 1527 6113364607 14534 0ustar laufersnobody Setting the prompt variable: BASH shell

Setting the prompt variable: BASH shell

Select an item for more information.


[Home] [Search] [Index]
examples/ 40755 1032 165141 0 6113364616 12101 5ustar laufersnobodyexamples/cp3.html100644 1032 165141 3455 6113364610 13552 0ustar laufersnobody Examples of using the cp command

Examples of using the cp command

To copy a file from your current working directory to a subdirectory:

   cp fig2 part2/figure2

This copies the file fig2 from your current working directory to the file figure2 in the subdirectory part2.


To copy a file to the parent directory:

   cp mail.txt ..

This copies the file mail.txt to the directory immediately above the current working directory.

The .. (dot dot) is shorthand for the parent directory.


To copy a file from a subdirectory to a directory elsewhere in the file system:

   cp docs/vi.Z /tmp

This copies the file vi.Z in the subdirectory docs to the directory /tmp.


To copy a file to your home directory:

   cp /usr/local/doc/ue.txt $HOME

This copies the file ue.txt to your home directory. $HOME is the environment variable that contains the value for your home directory.


[Home] [Search] [Index]
examples/cp4.html100644 1032 165141 3553 6113364610 13552 0ustar laufersnobody Examples of using the cp command

Examples of using the cp command

To copy a file from a subdirectory to the current working directory:

   cp notes/note3 sect3.txt

This copies the file note3 from the subdirectory notes to the file sect3 in the current working directory. A relative pathname notes/note3 is used to define the source file.


To copy a file from another directory to the current working directory, preserving the file name:

   cp /usr/lib/more.help .

This creates a copy of the file more.help in the current working directory. A full pathname /usr/lib/more.help is used to define the source file.


To copy a file from another user's directory using a relative pathname:

   cp ~helper/tmp/for_john tmp/comments

This copies the file for_john from the directory tmp in which is in the home directory of the user helper, to a directory with the same name in the user's home directory. The name of this new file is comments.

Notice that a relative pathname ~helper/tmp/for_john is used to define the source file.


[Home] [Search] [Index]
examples/cp5.html100644 1032 165141 2312 6113364610 13543 0ustar laufersnobody Examples of using the cp command

Examples of using the cp command

To copy a file from another user's home directory:

   cp ~helper/file1 file2

This copies file1 from the home directory of user helper to file2 in your current working directory.


To copy a file from a subdirectory in the user's home directory:

   cp ~helper/book/part2/file1 file2

This copies file1 from the subdirectory book/part2/ in the home directory of user helper to file2 in your current working directory.


[Home] [Search] [Index]
examples/cp_wildcards.html100644 1032 165141 2566 6113364610 15525 0ustar laufersnobody Examples of using cp with special characters

Examples of using cp with special characters

To copy files that match on several characters:

   cp *.txt chapt1

This copies all the files in the current working directory with the extension ".txt" to the sub-directory chapt1.


To copy files that match on a single character:

   cp sect?b partA

This copies any file with the name sect[1-9]b to the sub-directory partA.


To copy all the files within a specified range:

   cp sect[1-4]c partB

This copies files sect1c, 2c, 3c and sect4c to the sub-directory partB.


[Home] [Search] [Index]
examples/create.html100644 1032 165141 2266 6115615173 14334 0ustar laufersnobody Examples of creating files

Examples of creating files

To create a file with the cat command:

   cat > memo
   remember to make appointment at opticians
   get cost of scheduled flight to Athens Ctrl-d

This creates a file called memo in the current directory containing two lines of text.


To create a file with the echo command:

   echo use an editor for large files > tips

This creates a file called tips in the current directory containing a single line of text.


[Home] [Search] [Index]
examples/find.html100644 1032 165141 3154 6113364611 14002 0ustar laufersnobody Examples of using the find command

Examples of using the find command

To find a single file below the current directory:

   find . -name mtg_jan92 -print

This displays the pathname to the file mtg_jan92 starting from the current directory. If the file is not found nothing is displayed.


To find a file below your home directory:

   find ~/ -name README -print

This displays the pathname to every file with the name README in your home directory or its subdirectories.


To find several files below the current directory:

   find . -name '*.fm' -print

This displays the pathname to any file with the extension .fm which exists below the current directory.


To find a directory:

   find /usr/local -name gnu -type d -print

This searches to see if there is a subdirectory gnu in the directory /usr/local.


[Home] [Search] [Index]
examples/find2.html100644 1032 165141 3223 6113364611 14061 0ustar laufersnobody Examples of executing commands with the find command

Examples of executing commands with the find command

To remove several files:

   find . -name 'mtg_*' -print -exec rm {} \;

This will search for and remove all files starting with the expression mtg_ from the current directory and its subdirectories.


To find and remove specific files:

   find . -name '*.tmp' -ctime +30 -print -exec rm {} \;

This removes all files in the current directory and its subdirectories with the filename extension .tmp which have not been changed within the last 30 days.


To find and remove files interactively;

   find ~/Docs -name '*.ps' -print -ok rm {} \;

This searches for files with the extension .ps starting in the subdirectory "Docs" in the user's home directory. Each time a file is found that matches this expression, the user is prompted to confirm that they want to remove it.

Entering y removes the file.


[Home] [Search] [Index]
examples/index.html100644 1032 165141 3050 6113364611 14164 0ustar laufersnobody Changing access permissions using the chmod command

Changing access permissions using the chmod command

To give yourself permission to execute a file that you own:

   chmod u+x file1

This gives you execute permission for the file "file1".


To give members of your group permission to read a file:

   chmod g+r file2

This gives the group permission to read the file "file2".


To give read permission to everyone for a particular type of file:

   chmod a+r *.pub

This gives everyone permission to read all files with the extension .pub.


To give the group write and execute permission:

   chmod g+wx $HOME/SCCS

This gives all members of the group permission to place files in the directory SCCS in your home directory. They can also list (ls) the contents of this directory.


[Home] [Search] [Index]
examples/ls.html100644 1032 165141 4335 6113364611 13502 0ustar laufersnobody Examples of using the ls command

Examples of using the ls -l command

To do a 'long' list of a single file in your current directory:

   ls -l file1
   -rw-r--r--  2 unixjohn doc      3287 Apr  8 12:10 file1

This displays the following information about the file file1:

   -rw-r--r--     (access permissions)
   2              (number of links to this file)
   unixjohn       (owner)
   doc            (group ownership)
   3287           (size in bytes)
   Apr  8 12:10   (date and time last modified)

To do a long list of all the files in your current directory:

   ls -l
   -rw-------  1 erpl08  iss       4307 Jun 17 10:00 FAQ.xdh
   drwx------  2 erpl08  iss       1024 Jun 17 10:00 SCCS
   -rw-------  1 erpl08  iss      15119 Jun 17 10:00 commands.xdh
   -rw-------  1 erpl08  iss        266 Jun 17 10:00 concepts.xdh

This displays the following information about every file and directory in your current working directory.

   d              (this is a directory)
   rwx------      (access permissions)
   2              (number of links)
   erpl08         (owner)
   iss            (group ownership)
   1024           (size in bytes)
   Jun 17 10:00   (date and time last modified)

[Home] [Search] [Index]
examples/mail1.html100644 1032 165141 3444 6113364611 14067 0ustar laufersnobody Examples of mail addresses

Examples of mail addresses

When sending a mail message to a user on the same system:

   jane

This is the address for the user jane on the same system as the person sending the mail.


When sending a mail message to a user on another local system:

   ezax@frolix

This is the address for the user known as ezax on another local system frolix.


When sending a mail message to a user on another system in another domain:

   helper@ubik.ed

This is the address for the user helper on the system known as ubik, which is in the domain known as ed (for Edinburgh University).


When sending a mail message to a user on another system which is located in a higher domain:

   ivan@islay.bigfish.com

This is the address for mail to the user ivan on another system, islay. This system is in the domain of bigfish (for Big Fish Industries) which is itself in the domain known as com (for commercial).


[Home] [Search] [Index]
examples/mail10.html100644 1032 165141 2643 6113364611 14147 0ustar laufersnobody Examples of saving mail to folders

Examples of saving mail to folders

To save the current mail message to a folder:

   & s +usability
   "/home/eucs/john/mrtidy/usability" [Appended]

This saves the current message to the folder usability, which is in the directory defined by the set folder variable. The message will be appended to the existing file. If the file does not exist, it is created.


To save several messages to the same file:

   & s bob +frombob
   "/home/eucs/john/mrtidy/frombob" [New file]

This saves all the messages from the user bob to the the folder frombob, which is in the directory defined by the set folder variable.

In this example the folder does not already exist, so it is created.


[Home] [Search] [Index]
examples/mail11.html100644 1032 165141 2155 6113364612 14147 0ustar laufersnobody Examples of deleting mail messages

Examples of deleting mail messages

To delete the current mail message:

   & d

This deletes the current mail message.


To delete a range of messages:

   & d 7-12

This deletes messages seven to twelve.


To delete all the messages that you have read:

   & d :r

This deletes all the messages that you have read since you began this session with the mail program.


[Home] [Search] [Index]
examples/mail12.html100644 1032 165141 1334 6113364612 14146 0ustar laufersnobody Undeleting messages

Undeleting messages

To cancel a delete command:

   & u 7

This cancels a previous command to delete message seven.


[Home] [Search] [Index]
examples/mail13.html100644 1032 165141 2755 6113364612 14157 0ustar laufersnobody Replying to mail messages

Replying to mail messages

To reply to the sender of the current message:

   & R
   To: bob
   Subject: Re: Travel arrangements

This creates a reply to the sender of the current message. The content of the Subject: field is taken from the existing message.

The user can now continue to send the mail message containing their reply.


To reply to all the original recipients of a particular mail message:

   & r 4
   To: scott tony adam jane
   Subject: Re: XGator

This creates a reply to all the original recipients of message number 4 in the mail file that is presently being read. The content of the Subject: field is taken from the existing message.

The user can now continue to send the mail message containing their reply.


[Home] [Search] [Index]
examples/mail14.html100644 1032 165141 3002 6113364612 14142 0ustar laufersnobody Examples of reading other mail files

Examples of reading other mail files

To read the messages in the the mbox file:

   mail -f

To read the messages stored in another file:

   mail -f usability

This starts the mail program, which displays the mail messages you have stored in the file usability.


To read the messages stored in a folder:

   mail -f +frombob

This starts the mail program, which displays the mail messages that are stored in the folder frombob.

The user has defined a mail environment variable so that folders are automatically created in a particular directory, whenever they save a mail message.

The + (plus sign) tells the mail program to look for the file frombob in the directory defined by this variable.


[Home] [Search] [Index]
examples/mail2.html100644 1032 165141 2232 6115615256 14070 0ustar laufersnobody Example of sending mail

Example of sending mail

To compose and send a mail message to another user:

   mail admin<Return>
   Subject: travel arrangements<Return>
   please book me a seat on the 8.00 a.m.<Return>
   BA shuttle to Heathrow.<Return>
   <Return>
   dave<Return>
   .<Return>

The text that the user types is shown in bold.

<Return> is shown wherever the users presses the Return key.


[Home] [Search] [Index]
examples/mail3.html100644 1032 165141 2102 6113364612 14060 0ustar laufersnobody Example of inserting a file into mail

Example of inserting a file into mail

To insert a file into a mail message:

   here is my first go at that README 
   file that I agreed
   to draft
   ~r project/README
   "project/README" 136/4637

This copies the file README in the subdirectory project into the mail message at this point.

The message

   filename: No such file or directory

is displayed if the file is not found.


[Home] [Search] [Index]
examples/mail4.html100644 1032 165141 3262 6115615321 14067 0ustar laufersnobody Examples of sending Cc: and Bcc: copies

Examples of sending Cc: and Bcc: copies

To send a carbon copy to another user:

   the system does its job admirably.
   ~c neil@dali<RETURN>
   You might also find that

When the mail is sent, a copy will also be sent to the user neil on the system dali. The original recipient of the mail will see that a copy has been sent to this person.


To send a carbon copy to several other users:

   take a look at MetaCard from the
   MetaCard Corporation
   ~c db@glas, fra@durham, lor@city

When the mail is sent, a copy will also be sent to each of the users whose addresses follow the ~c command. Each address is followed by a comma (,).


To send a blind carbon copy to another user:

   be treated in total confidence
   ~b peter
   Regards
   John Smith

When the mail is sent, a blind carbon copy will also be sent to the user peter. The recipient of the mail will not know that this copy has been sent.


[Home] [Search] [Index]
examples/mail5.html100644 1032 165141 2654 6115615360 14077 0ustar laufersnobody Examples of using UNIX shell commands

Examples of using UNIX shell commands

To use a UNIX command while you are preparing a mail message:

   the application is in
   ~! which guide
   /usr/local/bin/guide
   !
   the directory /usr/local/bin

This displays the output from the command"

   which guide

To include the output from a UNIX command in the mail message:

   the IP address for my Mac is
   ~<! grep jazz /etc/hosts
   " grep jazz /etc/hosts" 1/30
    Alternatively you can call it as jazz.ucs

This inserts the output from the command:

   grep jazz /etc/hosts

into the mail message at this point. Notice that command is echoed to indicate that it has been carried out, but that the command output is not displayed.


[Home] [Search] [Index]
examples/mail6.html100644 1032 165141 2704 6115615525 14077 0ustar laufersnobody Example of how mail is displayed

Example of how mail is displayed

This is an example of how mail is displayed.

   Mail version SMI 4.0 Thu Oct 11 12:59:09 PDT 1990  Type ? for help.
   "/usr/spool/mail/fred": 5 messages 2 new 1 unread
    *  1  F.Bloggs@ed       Wed Jun 1   14:22   108/4120  using mail
       2  Scott@ucl.cs      Wed Jun 1   20:17   37/1648   RFI
    U  3  colin             Fri Jun 3   11:37   43/1372   usability testing 
   >N  4  karen@ed.music    Fri Jun 3   11:54   16/365    meeting
    N  5  jcarr@ed.lfcs     Sun Jun 5   18:29   19/391    Re:Using mail
   &

Each message has a number, followed by information about that message. At the beginning of each line is a status indicator:

   
	>	the current message

	U	message has not been read

	N	this is a new message

	*	message has been saved

	(blank) message has been read but not saved

[Home] [Search] [Index]
examples/mail7.html100644 1032 165141 3175 6115615572 14105 0ustar laufersnobody Examples of reading mail

Examples of reading mail

To read the current message:

   <Return>

This will display the current message, as indicated by the > symbol.


To display a message by its number:

   5

This will display the contents of message number 5.


To display a range of messages by number:

   4-7

This will display messages 4 through 7, starting at message 4. Press <Return> to go to the next message.


To display all the messages from a specific user:

   p bob

This displays all the messages in your mailbox from the user bob, starting from the first message received.

Press <Return> to go to the next message in the series.


To redisplay the mail headers:

   h

This redisplays the the mail headers, showing you what mail you have in your mailbox.


[Home] [Search] [Index]
examples/mail8.html100644 1032 165141 2123 6113364613 14071 0ustar laufersnobody Example of exiting mail with the "q" command

Example of exiting mail with the "q" command

This is the type of message you might see after you quit the mail program:

   &q
   Saved 1 message in /home/eucs/erpl08/mbox
   Held 6 messages in /usr/spool/mail/erpl08

The user erpl08 had seven messages in their mailbox. Before quitting they read one of these messages, which is saved to the file mbox in their home directory.

The other messages are held in their system mailbox.


[Home] [Search] [Index]
examples/mail9.html100644 1032 165141 2664 6113364614 14105 0ustar laufersnobody Examples of saving mail messages

Examples of saving mail messages

To save the current mail message to a file:

   & s junk

This saves the current mail message to the file junk in the current directory.


To save several mail messages to the same file:

   & s 5 8 14 project/feedback

This saves messages 5, 8 and 14 to the file feedback. This file is in the the subdirectory tmp of the directory from which the mail program is being run.


To save all the messages from a particular user:

   & s cayman xgator

This saves all the messages with the string cayman in the From: field of their message header to the file xgator.


[Home] [Search] [Index]
examples/mailrc.html100644 1032 165141 2604 6113364614 14333 0ustar laufersnobody Sample .mailrc file

Sample .mailrc file

Lines starting with a # contain comments on the line(s) above them.

   Sample .mailrc file
   set askcc hold keepsave editheaders
   # This line sets four variables. By default, these variables are
   # not set. Variables can also be set one to a line.
   set folder=mrtidy
   # Sets the directory for files that hold the mail messages that
   # you save. This directory is in the user's home directory.
   set PAGER=less
   # Defines the pager to be used to view mail messages that are
   # longer than a single screenful.
   set VISUAL=/usr/local/bin/ue
   # Sets the editor that is called when you enter the command ~v
   # while composing a mail  message.
   sign="The Boy in the Bubble"
   # The "signature that is inserted in your mail message with the
   # ~a command.

[Home] [Search] [Index]
examples/man.html100644 1032 165141 4006 6113364614 13635 0ustar laufersnobody Examples of using the man command

Examples of using the man command

To get an overview of section 1 (one) of the manual:

   man 1 intro

This section deals with user commands: the commands you are most likely to use.


To search the online manual for a command with the keyword "mail":

   man -k mail

This displays a one line synopsis of each command that has this keyword in its description.


To search the online manual for a command with the phrase "copy files":

   man -k 'copy files'

This displays a one line synopsis for each command that has this phrase in its description.


To check what a command does:

   whatis more
   more, page (1)    - browse or page through a text file

This displays a one line description of what the command does.


To display the manual page for the cp (copy files) command:

   man cp

--More--48% at the bottom left of the screen means that only 48% of the man page is displayed.

Press the space bar to display more of it or type q to quit.


To print the manual page for the man command:

   man -t man

This prints the manual page to your default printer.


[Home] [Search] [Index]
examples/permissions.html100644 1032 165141 3055 6113364614 15440 0ustar laufersnobody Examples of access permissions

Examples of access permissions

   ls -l file1
   -rw-------  2 unixjohn     3287 Apr  8 12:10 file1

The owner of the file has read and write permission.


   ls -l file2
   -rw-r--r--  2 unixjohn     3287 Apr  8 12:11 file2

The owner has read and write permission. Everyone else - the group and all other users - can read the file.


   ls -l myprog
   -rwx--x--x  2 unixjohn     3287 Apr  8 12:10 myprog

The user has read, write and execute permission. Everyone else -the group and all others- can execute the file.


   ls -l
   ...
   drwxr-x---  2 erpl08       1024 Jun 17 10:00 SCCS

This is a directory. The user has red, write and execute permission. The group has read and execute permission on the directory. Nobody else can get access to it.


[Home] [Search] [Index]
examples/rlogin.html100644 1032 165141 2510 6113364614 14352 0ustar laufersnobody Examples of using the rlogin command

Examples of using the rlogin command

To login to the remote system iona using the same username:

   rlogin iona
   Password:

This logs the user in to their account on the remote system named iona. Their username on this sytem is identical to their username on the system they are currently using.


To login to the remote system barra using the username helper:

   rlogin barra -l helper
   Password:

This logs the user in to the remote system named barra on which they have an account for the username helper. This username is different to their username on the system they are currently logged in to.


[Home] [Search] [Index]
examples/sh.html100644 1032 165141 3137 6113364615 13501 0ustar laufersnobody Examples of changing environment variables: Bourne shell

Examples of changing environment variables: Bourne shell

To change to using another printer for the current login session:

   PRINTER=ps2

Whenever the user prints a file, the output will be sent to the printer ps2.


To change to using another editor for the current login session and inform (export) this value to other programs which use it:

   EDITOR=vi
   export EDITOR

This changes the user's default editor to vi and exports this value to other programs - such as electronic mail - which make use of it.


To change to using another pager for viewing files the user adds the following lines to their .profile file.

   PAGER=less;export PAGER

To make this change take immediate effect enter the command:

   . .profile

This causes the .profile file to be read, setting the variables to their new values.


[Home] [Search] [Index]
examples/telnet.html100644 1032 165141 2250 6115615627 14361 0ustar laufersnobody Examples of using the telnet command

Examples of using the telnet command

To connect to your account on the remote system known as "castor":

   telnet castor
   Trying 129.215.112.8 ...
   Connected to castor.ucs.ed.ac.uk.
   Escape character is '^]'.


   SunOS UNIX (castor)

   login:

To start a telnet session and open a connection to the host "mstore-1":

   telnet
   telnet> open mstore-1
   Trying 129.215.112.1 ...
   Connected to mstore-1.ucs.ed.ac.uk.
   Escape character is '^]'.


   SunOS UNIX (mstore-1)

   login:

[Home] [Search] [Index]
examples/umask.html100644 1032 165141 3246 6113364615 14210 0ustar laufersnobody Examples of using the umask command

Examples of using the umask command

To give yourself full permissions for both files and directories and prevent the group and other users from having access:

   umask 077

This subtracts 077 from the system defaults for files and directories 666 and 777. Giving a default access permissions for your files of 600 (rw-------) and for directories of 700 (rwx------).


To give all access permissions to the group and allow other users read and execute permission:

   umask 002

This subtracts 002 from the sytem defaults to give a default access permission for your files of 664 (rw-rw-r--) and for your directories of 775 (rwxrwxr-x).


To give the group and other users all access except write access:

   umask 022

This subtracts 022 from the system defaults to give a default access permission for your files of 644 (rw-r--r--) and for your directories of 755 (rwxr-xr-x).


[Home] [Search] [Index]
examples/vi1.html100644 1032 165141 2513 6113364615 13563 0ustar laufersnobody Examples of starting vi and opening files

Examples of starting vi and opening files

To open an existing file for editing:

   vi intro

This opens the file intro for editing. This file already exists in the current directory.


To create a file to edit:

   vi part2

This command starts vi with a new file named part2. This file does not exist in the current directory until it is written to using the write command.


To simply start vi:

   vi

This command places you in vi. You can then enter and edit text and write it to a file.


[Home] [Search] [Index]
examples/vi2.html100644 1032 165141 3626 6115615671 13575 0ustar laufersnobody Examples of replacing text

Examples of replacing text

To replace one word in the current line with another:

   :s/that/which

This replaces the first instance of the word "that" in the current line with the word "which".


To replace every instance of one word in the current line with another:

   :s/destroy/delete/g

This replaces every occurrence of the word "destroy" with the word "delete" in the current line.


To replace every occurence of a word throughout the file, with another:

   :g/insert/s//add/g

This replaces every occurence of "insert" with "add".


To interactively replace every occurence of a word throughout the file, with another:

   :g/in conjunction with/s//with/gc
   option used in conjunction with the ls command
           ^^^^^^^^^^^^^^^^^^

This displays the first line containing an occurence of the pattern "in conjunction with", and identifies this occurence by underlining each character with a ^ (caret).

Entering y (yes) replaces this instance of "in conjunction with" by "with" and proceeds on to the next.

Pressing <RETURN> leaves this instance unchanged and proceeds to the next.


[Home] [Search] [Index]
examples/vi3.html100644 1032 165141 2036 6113364615 13565 0ustar laufersnobody Examples of repeating parts of the text

Examples of repeating parts of the text

To yank the the current sentence into the temporary buffer:

   y)

To yank the text from the present cursor position to the the beginning of the current paragraph into the temporary buffer:

   y{

To place the contents of the temporary buffer after the current cursor position:

   p

[Home] [Search] [Index]
examples/vi4.html100644 1032 165141 2266 6113364616 13574 0ustar laufersnobody Examples of inserting the contents of another file

Examples of inserting the contents of another file

To insert a file immediately after the line containing the cursor:

   :r examples.txt

This inserts the contents of the file examples.txt immediately after the current line.


To insert the contents of another file after a specific line in the current file:

   23:r toc.txt

This inserts the contents of the file toc.txt after line 23 of the current file. Line 24 is empty; the contents of the inserted file begin at line 25.


[Home] [Search] [Index]
examples/vi5.html100644 1032 165141 2160 6113364616 13566 0ustar laufersnobody Examples of setting vi options temporarily

Examples of setting vi options temporarily

To set the wrapmargin:

   :set wm=5

This sets the wrapmargin to five characters. In insert mode, text will automatically wrap to a new line when the cursor is five characters from the right edge of the screen.


To display line numbers:

   :set number

This causes vi to display a line number (starting at 1) at the start of every line of text.


[Home] [Search] [Index]
examples/vi6.html100644 1032 165141 3031 6113364616 13565 0ustar laufersnobody Examples of setting vi options permanently

Examples of setting vi options permanently

To set a number of options place the set commands in the file .exrc.

   set ic
   set number
   set sh=/usr/local/bin/Tcsh
   set wm=5

This sets vi to:

  1. ignore the case of characters in searches
  2. display line numbers
  3. use the TC shell to execute UNIX commands
  4. wrap text five characters from the right edge of the screen

Options can also be set using the environment variable EXINIT.

   setenv EXINIT 'set ic number sh=/usr/local/bin/Tcsh wm=5'

For the C and TC shell user, this sets the same options as in the example above.

If there is a .exrc file owned by you in your home directory or the current directory, vi will take its option values from this and not from the EXINIT environment variable.


[Home] [Search] [Index]
examples/wildcards.html100644 1032 165141 3674 6115615735 15055 0ustar laufersnobody Examples of using wildcard characters

Examples of using wildcard characters

To match any number of characters in a filename:

   ls *.txt

This lists all the files in the current directory that have the extension .txt - so Help.txt as well as nonsense.txt would be listed.


To match any single character in a filename:

   cat memo? > mymemos

This concatenates all files with the filename

   memo0 -> memo9
   memoa -> memoz
   memoA -> memoZ

and places their contents in the file mymemos.


To remove a range of files:

   rm part[1-3]

This removes files part1, part2 and part3 from the current directory. If no files are found that match these names the message

   No match

is displayed.


To look for an expression in a file:

   grep '[Jj]ohn' < addresses

This looks for and, if found, displays the lines containing the name john or John in the file addresses.

Notice that the expression to be searched for is enclosed in 'quotes' to prevent the '[' character being interpreted by the shell.


[Home] [Search] [Index]
examples/cp1.html100644 1032 165141 2177 6113364616 13556 0ustar laufersnobody Examples of using the cp command

Examples of using the cp command

To copy a single file in the current directory:

   cp notes sect3.txt

This makes a copy of the file notes in the file sect3.txt.


To copy a file using the -i option:

   cp -i notes part2.txt

This makes a copy of the file notes in the file part2.txt. If this file exists, the message

   part2.txt: File exists

is displayed. The file is not copied.


[Home] [Search] [Index]
get_source.html100644 1032 165141 4315 6113364617 13411 0ustar laufersnobody Installing UNIXhelp locally

Installing UNIXhelp locally

UNIXhelp is available for anybody to use on the World Wide Web. However if you are based outside Edinburgh, you may find each page slow to load across the network. We would recommend installing a copy at your local site.

There may already be a UNIXhelp mirror site near you. If not, you may obtain the source files for the product by anonymous ftp. The main distribution site appears below but there may be an mirror of the distribution closer to you.


        Server:    ftp.ed.ac.uk

	Directory: pub/unixhelp

	Filename:  UNIXhelp1.3.tar.Z

	Size:      380K

	Format:    Compressed tar file

If your browser supports a binary file transfer mode you may download the source directly from this page.

You are encouraged to customise your local version of UNIXhelp. Detailed instructions are included with the distribution. If you author additional pages for mailers, editors or other utilities, please consider making these available for inclusion in future releases. Contact the UNIXhelp maintainer if you can help.

The Copyright for the UNIXhelp deliverables rests with the Computing Services of the University of Edinburgh. The deliverables may be reproduced and used freely for non-commercial purposes, provided that this and any other copyright notices are reproduced therein.


[Home] [Search] [Index]
glossary/ 40755 1032 165141 0 6113364623 12124 5ustar laufersnobodyglossary/gb.html100644 1032 165141 5444 6113364617 13511 0ustar laufersnobody UNIXhelp Glossary - "B"

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

binary file

a file that contains codes which are not part of the ASCII character set. A binary file can contain any type of information that can be represented by an 8 bit byte - a possible 256 values.

bit

a binary digit of information that can have either of two values, 1 or 0 (zero).

blind carbon copy

a copy of a message which all persons on the Bcc: list receive. Recipients cannot see who else has received the message: hence the term "blind".

boot

this term derives from `bootstrap loader', a short program that was read in from cards or paper tape, or toggled in from the front panel switches. This program was always very short (great efforts were expended on making it short in order to minimise the labour and chance of error involved in toggling it in), but was just smart enough to read in a slightly more complex program (usually from a card or paper tape reader), to which it handed control; this program in turn was smart enough to read the application or operating system from a magnetic tape drive or disk drive. Thus, in successive steps, the computer `pulled itself up by its bootstraps' to a useful operating state.

BSD

one of the major variants of UNIX

buffer

a temporary area of memory which data can be read from and written to.

byte

a unit of memory or data consisting of 8 bits which is used to represent one character.


[Home] [Search] [Index]
glossary/gc.html100644 1032 165141 3152 6113364620 13476 0ustar laufersnobody UNIXhelp Glossary - "C"

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

carbon copy

a copy of a message which all persons on the Cc: list receive. Recipients of the message can see who else it has been circulated to.

Central Processing Unit (CPU)

a logic chip that executes instructions passed to it.

current directory

the directory you are currently "in". Its value is displayed with the pwd command. It is synonymous with the term current working directory.


[Home] [Search] [Index]
glossary/gd.html100644 1032 165141 4516 6113364620 13504 0ustar laufersnobody UNIXhelp Glossary - "D"

[ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

daemon

a background process (pronounced "demon") that carries out tasks on behalf of every user. Daemons spend most of their time sleeping until something comes along which requires their help. A UNIX system has a lot of daemons.

database concepts

  • a database is the name given to the combination of a program that can manipulate data, together with the data that it acts upon.

  • a record is a set of data about a person or item. Name, telephone number and postcode is an example of such a set.

  • a field is one part of that record; the postcode for example.

  • a delimiter character separates each field from the field preceding it and the field that follows it. A colon (:) is often used as a field delimiter.

  • a key is the field or part of a field that the program uses when it acts on the data.

  • default

    a value to which some variable is automatically set, unless an alternative value is provided by the user.

    domain

    a part of a hierarchical naming scheme.


    [Home] [Search] [Index]
    glossary/ge.html100644 1032 165141 2361 6113364620 13501 0ustar laufersnobody UNIXhelp Glossary - "E"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    environment variable

    a variable that defines an aspect of your working environment such as your home directory, editor or printer. These variables are set during the login procedure.


    [Home] [Search] [Index]
    glossary/gf.html100644 1032 165141 3306 6113364620 13502 0ustar laufersnobody UNIXhelp Glossary - "F"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    file-creation mode mask

    a number consisting of three octal digits which is subtracted from a similar number used by the system to create files and directories.

    file system

    the physical or logical device that holds a collection of files and directories. This might be a hard disk drive or a partition on a disk drive.

    full pathname

    the name of a directory or file in relation to the root (/) directory.

    See UNIX File System for a more detailed explanation.


    [Home] [Search] [Index]
    glossary/gg.html100644 1032 165141 2177 6113364620 13510 0ustar laufersnobody UNIXhelp Glossary - "G"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    group

    a collection of users who have protected access to their resources.


    [Home] [Search] [Index]
    glossary/gh.html100644 1032 165141 2536 6113364620 13510 0ustar laufersnobody UNIXhelp Glossary - "H"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    home directory

    the directory you are placed in immediately after you login to the system.

    host

    a computer system that provides a working environment to many users. So a "UNIX host" is such a system that runs the UNIX operating system.


    [Home] [Search] [Index]
    glossary/gi.html100644 1032 165141 2441 6113364620 13504 0ustar laufersnobody UNIXhelp Glossary - "I"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    inode number

    a unique number associated with each filename. This number is used to look up an entry in the inode table which gives information on the type, size, and location of the file and the userid of the owner of the file.


    [Home] [Search] [Index]
    glossary/gl.html100644 1032 165141 2450 6146057326 13517 0ustar laufersnobody UNIXhelp Glossary - "L"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    link

    a connection between an inode number and the filename(s) associated with it.

    local host

    the host on the network which you are currently using.


    [Home] [Search] [Index]
    glossary/gm.html100644 1032 165141 2751 6113364621 13515 0ustar laufersnobody UNIXhelp Glossary - "M"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    mail header

    information contained in every mail message which is used by mail programs to provide the user with a summary of the origin and contents of each message.

    metacharacter

    a single character that is used in place of another character or set of characters.

    multitasking

    the execution of two or more processes at the same time.


    [Home] [Search] [Index]
    glossary/gp.html100644 1032 165141 4331 6170467346 13527 0ustar laufersnobody UNIXhelp Glossary - "P"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    page

    a screen of information in UNIXhelp. A screen may be scrollable.

    parent directory

    the directory that is one level above the current directory.

    password

    a security device consisting of a string of characters known only to the user and the system. The user must supply this string when prompted to gain access to the system.

    pathname

    a file name given as the sequence of directories that lead to the file. A pathname can be either a full pathname or a relative pathname.

    Select the item UNIX File System from the Concepts menu for a more detailed explanation.

    prompt (see shell prompt)

    protocol

    a set of rules that defines exactly how information is to be exchanged between two systems. This allows different types of machine to communicate in a form both understand.


    [Home] [Search] [Index]
    glossary/gq.html100644 1032 165141 1510 6113364621 13511 0ustar laufersnobody UNIXhelp Glossary - "Q"

    queue

    a system for managing the use of a shared resource, such as a printer or electronic mail agent. Items sent to the queue must wait for their turn to be processed. Higher priority items may be permitted to "skip the queue".


    [Home] [Search] [Index]
    glossary/gr.html100644 1032 165141 4173 6113364622 13523 0ustar laufersnobody UNIXhelp Glossary - "R"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    recursion

    the result of a program or command running a new version of itself. If done carelessly this can cause a never-ending loop. However as a programming technique it is often used to simplify such tasks as searching down through a directory tree.

    regular expression

    a text pattern consisting of a combination of alphanumeric characters and special characters known as metacharacters.

    relative pathname

    the name of a directory or file given in relation to your current working directory.

    See UNIX File System for a more detailed explanation.

    remote host

    any host on the network which you are not presently using.

    root directory

    the directory located at the top of the Unix file system. It is represented by the "/" (forward slash) character.


    [Home] [Search] [Index]
    glossary/gs.html100644 1032 165141 5523 6113364622 13524 0ustar laufersnobody UNIXhelp Glossary - "S"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    shell

    a utility program that enables the user to interact with the UNIX operating system. Commands entered by the user are passed by the shell to the operating system which carries them out. The results are then passed back by the shell and displayed on the user's display.

    There are several shells available. The user may select which one they wish to use.

    shell prompt

    a character at the start of the command line which indicates that the shell is ready to receive your commands. The character is usually a '%' (percent sign) or a $ (dollar sign). It may be different on your system.

    standard input

    the source of information for a command. This is assumed to be the keyboard unless input is redirected or piped from a file or another command.

    standard output

    the destination for information from a command. This is assumed to be the terminal display unless ouput is redirected or piped to a file or another command.

    syntax

    rules governing the way in which characters and words must be put together to form a command that can be recognised and acted upon by the UNIX operating system.

    system administrator

    a person or persons with responsibility for managing the system(s) you are using.

    System V

    one of the major variants of UNIX.


    [Home] [Search] [Index]
    glossary/gt.html100644 1032 165141 3142 6113364622 13520 0ustar laufersnobody UNIXhelp Glossary - "T"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    tarfile

    a file created using the Tape Archive Record format, often but not always written to magnetic tape. The most common use of this format is to package multiple files or directories into a single file for easy transfer or archive.

    text file

    a file that contains only ASCII characters, allowing it to be edited or used with programs that do not handle binary files, such as electronic mail.


    [Home] [Search] [Index]
    glossary/gu.html100644 1032 165141 2305 6113364622 13521 0ustar laufersnobody UNIXhelp Glossary - "U"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    username

    a unique "name" by which each user is known to the system. This name is given to the user whenever they register to use the system.


    [Home] [Search] [Index]
    glossary/index.html100644 1032 165141 2151 6113364623 14215 0ustar laufersnobody Glossary of Terms

    Glossary

    Select a letter to display all entries in the Glossary which begin with that letter.

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]


    [Home] [Search] [Index]
    glossary/ga.html100644 1032 165141 3712 6113364623 13501 0ustar laufersnobody UNIXhelp Glossary - "A"

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    access permissions

    a set of permissions associated with every file and directory that determine who can read it, write to it, or execute it. Only the owner of the file (or the super-user) can change these permissions.

    argument

    a mathematical term that refers to a number, character or word which changes the action of the command it is applied to.

    ASCII (American Standard Code for Information Interchange)

    a standard code used for representing information on computer systems and networks. It uses the printing and non-printing characters that can be generated by the keyboard. Since 7 bits are available to represent each character it is possible to represent a total of 128 different characters.

    A table of the ASCII character set can be found in the file /usr/pub/ascii on every UNIX system.


    [Home] [Search] [Index]
    guestftp/ 40755 1032 165141 0 6113364627 12126 5ustar laufersnobodyguestftp/2.html100644 1032 165141 2416 6113364624 13252 0ustar laufersnobody Accessing the Service

    Accessing the Service

    The service runs from a public account on uk.ac.nsf.sun (X29 address 000040010180). Make a call to this machine, and login as guestftp, using the password guestftp.

    You should then be presented with a screen of operational information, followed by update times of the `help' and `netnews' files. Please check these files if they have changed since the last time you used the service.

    The service will then ask you to supply a reference - this will be the name of the temporary directory where your files will be stored. Remember the reference - you will need it when transferring files to your home machine from uk.ac.nsf.sun.


    [Home] [Search] [Index]
    guestftp/3.html100644 1032 165141 4011 6115616200 13234 0ustar laufersnobody Using Guest FTP

    Using Guest FTP

    Having entered a reference (your name, for example), you should then receive a guest_ftp> prompt. The following commands are available from this prompt:

    
    dir             list files in your temporary directory.
    ref             display the name of your temporary directory.
    find            search the database for the Internet host/address.
    
    ret             retrieve files from PUBLIC directory.
    ftp             start an TCP/FTP request.
    push            push a file to a Janet NRS Host.
    pull            pull a file from a Janet NRS Host.
    q               display the status of your push/pull requests.
    
    netnews         display netnews file.
    gripe           send any gripes/suggestions to liaison.
    
    lo              logout.
    exit            logout.
    
    

    Note that all commands should be typed in lower case, and that command line arguments may not be used - simply enter the command, and you will be prompted for any further infor- mation that is required.

    The majority of these commands should be self-explanatory, however the commands ftp, push and pull will now be discussed in more detail.


    [Home] [Search] [Index]
    guestftp/4.1.html100644 1032 165141 3662 6115616242 13415 0ustar laufersnobody Retrieving a File from an InterNet Host

    Retrieving a File from an InterNet Host

    The next piece of dialogue illustrates how to transfer a file from an InterNet host into your directory on uk.ac.nsf.sun. This uses the ftp command get.

       ftp> get mailbox
       200 PORT command okay.
       150 Opening data connection for profile (128.41.9.3,1551) (118 bytes).
       226 Transfer complete.
       126 bytes received in 0.34 seconds (0.36 Kbytes/s)
       ftp>
    

    This will retrieve the remote file mailbox into a local file also called mailbox. It is also possible to transfer the remote file into a local file with a different name :

       ftp> get
       (remote-file) aliases
       (local-file) alias
       200 PORT command okay.
       150 Opening data connection for aliases (128.41.9.3,1553) (118 bytes).
       226 Transfer complete.
       126 bytes received in 11.66 seconds (0.011 Kbytes/s)
       ftp>
    

    This will transfer the file aliases on the remote machine to the file alias in your directory on uk.ac.nsf.sun.

    Once you have finished transferring files, you should close the connection and quit ftp:

       ftp> close
       221 Goodbye
       ftp> quit
       guest_ftp>
    

    [Home] [Search] [Index]
    guestftp/4.2.html100644 1032 165141 3302 6115616301 13401 0ustar laufersnobody Sending a File to an InterNet Host

    Sending a File to an InterNet Host

    Firstly, establish a connection with the remote machine, as illustrated in the previous section. Sending a file is identical to retrieving a file, except that the put command is used in place of get, eg:

       ftp> put rfc822.doc
       200 PORT command okay.
       150 Opening data connection for rfc822.doc (0.0.0.0,1315)
       226 Transfer complete
       98932 bytes sent in 4.02 seconds (24 Kbyte/s)
       ftp>
    

    Here, the local file rfc822.doc is sent to the remote host, which stores it under the same name.

       ftp> put
       (local-file) paper.doc
       (remote-file) paper.txt
       200 PORT command okay.
       150 Opening data connection for kermit_docs (0.0.0.0,1315).
       226 Transfer complete.
       97902 bytes sent in 4.51 seconds (21 Kbytes/s)
       ftp>
    

    In this case, the local file paper.doc is sent to the remote host, and stored as paper.txt.

    Again, once you have finished transferring files, close down the session as detailed previously.


    [Home] [Search] [Index]
    guestftp/4.3.1.html100644 1032 165141 2607 6115616334 13556 0ustar laufersnobody The hash command

    The hash command

    To monitor the progress of a transfer, it can be useful to enter the hash command before the transfer. This instructs ftp to print a `#' character for every 1024 bytes of data received. So long as a # appears every so often, the ftp is still in progress, and there are no problems.

       ftp> hash
       Hash mark printing on (1024 bytes/hash mark).
       ftp> get paper.txt
       200 PORT command okay.
       150 Opening data connection for paper.txt (0.50.50.54,1322).
       #################
       226 Transfer complete.
       16494 bytes sent in 0.98 seconds (16 Kbytes/s)
       ftp>
    

    The file transferred in this example was 15788 bytes in length, which with communication overheads was transferred in 16494 bytes. This causes 17 # marks to be printed.


    [Home] [Search] [Index]
    guestftp/4.3.2.html100644 1032 165141 2266 6115616353 13561 0ustar laufersnobody The binary and ascii commands

    The binary and ascii commands

    These commands are used to tell ftp what type of file is to be transferred, in order that the transfer will take place correctly.

    If the file you are transferring is a binary or 8 bit file (for example an executable file or an archive), you should issue a binary command to ftp before the get or put, ie:

       ftp> binary
       ftp> get paper.doc
    

    To switch back to transferring ordinary text or 7 bit files, issue an ascii command to ftp.


    [Home] [Search] [Index]
    guestftp/4.3.html100644 1032 165141 1316 6170466047 13420 0ustar laufersnobody Other ftp Commands

    Other ftp Commands


    [Home] [Search] [Index]
    guestftp/4.html100644 1032 165141 2656 6115616403 13257 0ustar laufersnobody The ftp Command

    The ftp Command

    This section deals with how to use InterNet ftp. Firstly, a connection must be made with an InterNet host, using the open command. The following dialogue illustrates this, note that data typed by the user is in bold.

       guest_ftp> ftp
       ftp> open vax.bbn.com
       Connected to vax.bbn.com.
       220 bbn-vax FTP server (Version 4.87 Thu Jul 12 18:59:05 EDT 1984) ready.
       Name (vax.bbn.com:): fred
       331 Password required for fred.
       Password (vax.bbn.com:fred): password
       230 User fred logged in.
       ftp>
    

    [Home] [Search] [Index]
    guestftp/4b.html100644 1032 165141 4073 6115616061 13414 0ustar laufersnobody ftp: More...

    ftp: More...

    To obtain a list of files on the remote machine, enter the ls command :

       ftp> ls
       200 PORT command okay.
       150 Opening data connection for /bin/ls (128.41.9.3,1550) (0 bytes).
       aliases
       aliases-c
       bindings
       bindings-c
       emacs/12762
       emacs/pro
       login_profile
       mailbox
       profile
       226 Transfer complete.
       179 bytes received in 12.22 seconds (0.014 Kbytes/s)
       ftp>
    

    Other commands are also available from the ftp> prompt, although the majority of these are outside the scope of this document. Entering the command ? will give a list of them:

       ftp> ?
       Commands may be abbreviated.  Commands are:
    
       !               dir             mget            quit            trace
       append          form            mkdir           quote           type
       ascii           get             mls             recv            user
       bell            glob            mode            remotehelp      verbose
       binary          hash            mput            rename          ?
       bye             help            open            rmdir
       cd              lcd             prompt          send
       close           ls              sendport        status
       delete          mdelete         put             struct
       debug           mdir            pwd             tenex
    

    For more information on a command, type help <command> within ftp.


    [Home] [Search] [Index]
    guestftp/5.1.html100644 1032 165141 2317 6113364626 13416 0ustar laufersnobody Initiating Transfers on Your Local Machine

    Initiating Transfers on Your Local Machine

    This is the preferred method of transferring files to and from uk.ac.nsf.sun. We strongly encourage you adopt this method, since it is almost certain to be the fastest.

    Since there are a variety of machines on JANET, you are advised to check with your Computing Services as to how the file transfer software on the machine you are using works.

    In general, on Unix machines the transfer command will be hhcp or cpf. On VAX/VMS systems, the command is usually called transfer.


    [Home] [Search] [Index]
    guestftp/5.2.html100644 1032 165141 2103 6113364626 13410 0ustar laufersnobody Transferring Files from uk.ac.nsf.sun to a Local Host

    Transferring Files from uk.ac.nsf.sun to a Local Host

    This is straightforward, simply remember that when you give the name of the file on the relay machine, precede it with your reference. For example, if your reference is tony and you have transferred a file from the InterNet called XX.tar.Z, the filename you need to give is tony/XX.tar.Z.

    The remote username and password are guestftp and guestftp.


    [Home] [Search] [Index]
    guestftp/5.3.html100644 1032 165141 3253 6115616431 13414 0ustar laufersnobody Transferring Files from a Local Host to uk.ac.nsf.sun

    Transferring Files from a Local Host to uk.ac.nsf.sun

    Due to the nature of a public account such as guestftp, preparing a file for transfer to the InterNet is a two stage process. Firstly, you need to transfer the file from your machine to uk.ac.nsf.sun, where it will be placed in a general area. You should then login to the guestftp service as usual and retrieve the file from this area.

    For example, if you have a file foo.c on your local machine, transfer this using the remote filename foo.c, and remote username and password of guestftp.

    Once this transfer has completed, login to the guestftp service, and the ret command to place the file in your directory on uk.ac.nsf.sun:

       guest_ftp> ret
       Give name of file to be retrieved: foo.c
       Trying to retrieve now, result is..OK.
       guest_ftp> dir
       26 Jun 19 17:07 foo.c
       total blocks: 400
       guest_ftp>
    

    The file is now ready to send to the US using the ftp command.


    [Home] [Search] [Index]
    guestftp/5.4.html100644 1032 165141 5055 6115616154 13421 0ustar laufersnobody Initiating Transfers on uk.ac.nsf.sun

    Initiating Transfers on uk.ac.nsf.sun

    (If at all possible, you should avoid using this method, as it is likely to be very slow.)

    The guestftp commands push and pull are used to manipulate JANET file transfers on uk.ac.nsf.sun. Each will prompt you for the relevant information, the following piece of dialogue illustrates the push command for sending a file from the relay machine to your own JANET host. The pull command works in a similar way.

       guest_ftp> push
    

    Okay lets push a file using NIFTP:

       Give local filename: foo.c
       Give remote filename: foo.c
       Give NRS name of remote host: uk.ac.ulcc
       Do you want binary or <default> ascii (input b or a): b
       Ok binary it is - input word size <default 8>: 32
       Give user name on remote host: tony
       Give user password on remote host: password
       Re-type password to make sure: password
       Push status-> OK - Request sent to the Spooler - use "q" to check
       guest_ftp>
    

    Note that when you enter passwords, they will not echo on the screen.

    To check the status of files you have queued for transfer on uk.ac.nsf.sun, use the q command. Note that this is the only way to check the status - you will not receive any error message should the transfer fail. The STATUS column will indicate how the transfer is proceeding - `done' indi- cates the transfer is complete.

       guest_ftp> q
       ID TIME  QUEUED L-FILE         STATE USER   R-FILE
       7018 Jun 19 17:20 estftp/tb/foo.c pend guestftp foo.c
       guest_ftp> q
       ID TIME  QUEUED L-FILE         STATE USER   R-FILE
       7018 Jun 19 17:20 estftp/tb/foo.c done guestftp foo.c
       guest_ftp>
    

    [Home] [Search] [Index]
    guestftp/5.html100644 1032 165141 2417 6113364626 13260 0ustar laufersnobody Transferring Files from uk.ac.nsf.sun to JANET Hosts

    Transferring Files from uk.ac.nsf.sun to JANET Hosts

    Obviously it is necessary to transfer files between uk.ac.nsf.sun and your own host machine on JANET. There are two methods of doing this, essentially it is a matter of which machine you initiate the transfer process on. This can either be done on uk.ac.nsf.sun, or on your own local machine.


    [Home] [Search] [Index]
    guestftp/6.html100644 1032 165141 1322 6113364626 13253 0ustar laufersnobody Problems?

    Problems?

    If you experience problems with the service, contact liaison@uk.ac.nsfnet-relay (by e-mail), or phone 0171-405 8400 extension 373.


    [Home] [Search] [Index]
    guestftp/7.html100644 1032 165141 2056 6113364627 13262 0ustar laufersnobody Documentation via info-server@uk.ac.nsfnet-relay

    Documentation via info-server@uk.ac.nsfnet-relay

    If you wish to get this document direct from the mail based `info-server' please send a message to info-server@uk.ac.nsfnet-relay with a message containing the following body:

       Request: guestftp
       Topic: userguide
       Request: end
    

    Topic userguide.ps will retrieve the PostScript version of the userguide, userguide will retrieve plain ASCII text.


    [Home] [Search] [Index]
    guestftp/authors.html100644 1032 165141 1552 6113364627 14601 0ustar laufersnobody Authors

    Authors

    The authors of this guide to the Guest FTP service are:

    Tony Bates and Duncan Rogerson (duncan@noc.ulcc.ac.uk)

    University of London Computer Centre, Networks Group

    This guide is reproduced here by permission of the University of London Computing Centre.


    [Home] [Search] [Index]
    guestftp/index.html100644 1032 165141 2046 6113364627 14222 0ustar laufersnobody The Guest FTP Service; User Guide

    The Guest FTP Service; User Guide


    [Home] [Search] [Index]
    guestftp/1.html100644 1032 165141 1772 6113364627 13260 0ustar laufersnobody Introduction

    Introduction

    The Guest FTP Service at the University of London Computer Centre provides a gateway service between InterNet file transfer protocol (FTP), and the file transfer mechanism used over JANET (Blue Book NIFTP).

    Suppose you can only transfer files between your local host and other remote hosts on JANET using the hhcp command. This service enables you to transfer files to and from hosts on the InterNet through its gateway.


    [Home] [Search] [Index]
    index/ 40755 1032 165141 0 6113364633 11371 5ustar laufersnobodyindex/ib.html100644 1032 165141 4266 6113364627 12761 0ustar laufersnobody Index: B

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    B


    [Home] [Search] [Index]
    index/ic.html100644 1032 165141 11145 6113364630 12766 0ustar laufersnobody Index: C

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    C


    [Home] [Search] [Index]
    index/id.html100644 1032 165141 6040 6113364630 12745 0ustar laufersnobody Index: D

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    D

    • directory See directories

    [Home] [Search] [Index]
    index/ie.html100644 1032 165141 7030 6113364630 12746 0ustar laufersnobody Index: E

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    E

    • electronic mail (see mail)

    [Home] [Search] [Index]
    index/if.html100644 1032 165141 10563 6113364630 12774 0ustar laufersnobody Index: F

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    F


    [Home] [Search] [Index]
    index/ig.html100644 1032 165141 4001 6113364630 12743 0ustar laufersnobody G

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    G

    • get
      • files from remote hosts
        • with ftp program
        • with hhcp command

    [Home] [Search] [Index]
    index/ih.html100644 1032 165141 3477 6113364630 12764 0ustar laufersnobody Index: H

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    H


    [Home] [Search] [Index]
    index/ii.html100644 1032 165141 3123 6113364631 12752 0ustar laufersnobody Index: I

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    I


    [Home] [Search] [Index]
    index/ij.html100644 1032 165141 3774 6113364631 12767 0ustar laufersnobody Index: J

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    J

    • Joint Academic NETwork (see JANET)

    [Home] [Search] [Index]
    index/ik.html100644 1032 165141 3203 6113364631 12753 0ustar laufersnobody Index: K

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    K


    [Home] [Search] [Index]
    index/il.html100644 1032 165141 5010 6113364631 12752 0ustar laufersnobody Index: L

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    L


    [Home] [Search] [Index]
    index/im.html100644 1032 165141 10217 6166207562 13007 0ustar laufersnobody Index: M

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    M

    • mailx (see mail)

    [Home] [Search] [Index]
    index/in.html100644 1032 165141 3250 6113364631 12760 0ustar laufersnobody Index: N

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    N


    [Home] [Search] [Index]
    index/index.html100644 1032 165141 2552 6113364631 13465 0ustar laufersnobody INDEX

    INDEX

    Select a letter to display all entries in the Index which begin with that letter.

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]


    [Home] [Search] [Index]
    index/io.html100644 1032 165141 3473 6113364632 12771 0ustar laufersnobody Index: O

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    O


    [Home] [Search] [Index]
    index/ip.html100644 1032 165141 11011 6113364632 12775 0ustar laufersnobody Index: P

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    P


    [Home] [Search] [Index]
    index/iq.html100644 1032 165141 3055 6113364632 12767 0ustar laufersnobody Index: Q

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    Q


    [Home] [Search] [Index]
    index/ir.html100644 1032 165141 5600 6113364632 12766 0ustar laufersnobody Index: R

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    R


    [Home] [Search] [Index]
    index/is.html100644 1032 165141 12716 6113364632 13015 0ustar laufersnobody Index: S

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    S


    [Home] [Search] [Index]
    index/it.html100644 1032 165141 5674 6113364632 13003 0ustar laufersnobody Index: T

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    T


    [Home] [Search] [Index]
    index/iu.html100644 1032 165141 2721 6113364633 12773 0ustar laufersnobody Index: U

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    U


    [Home] [Search] [Index]
    index/iv.html100644 1032 165141 5710 6113364633 12775 0ustar laufersnobody Index: V

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    V


    [Home] [Search] [Index]
    index/iw.html100644 1032 165141 3143 6113364633 12774 0ustar laufersnobody Index: W

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    W


    [Home] [Search] [Index]
    index/ix.html100644 1032 165141 2501 6113364633 12772 0ustar laufersnobody Index: X

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    X


    [Home] [Search] [Index]
    index/iy.html100644 1032 165141 2501 6113364633 12773 0ustar laufersnobody Index: Y

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    Y


    [Home] [Search] [Index]
    index/iz.html100644 1032 165141 2501 6113364633 12774 0ustar laufersnobody Index: Z

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    Z


    [Home] [Search] [Index]
    index/ia.html100644 1032 165141 5121 6113364633 12744 0ustar laufersnobody Index: A

    [ A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ]

    A

    • arithmetic
      • done with expr command

    [Home] [Search] [Index]
    index.html100644 1032 165141 6327 6142141031 12347 0ustar laufersnobody UNIXhelp for users

    UNIXhelp for Users


    Helpful information for users of the UNIX operating system, developed at the University of Edinburgh from work funded by the ITTI. Please read this disclaimer.

    UNIXhelp is mirrored around the world and freely available for local installation. This is Version 1.3.


    [ Manual Index | Searchable Index | Glossary of Terms ]


    Tasks


    Commands


    Concepts


    Utilities


    [Home] [Search] [Index]
    local/ 40755 1032 165141 0 6113364635 11356 5ustar laufersnobodylocal/printers.html100644 1032 165141 1436 6113364634 14212 0ustar laufersnobody Local command(s) for showing available printers

    Local command(s) for showing available printers

    Put in the details of any local utilities that enable the user to find descriptions of the printers that are available for their use at the local site.


    [Home] [Search] [Index]
    local/rcp.html100644 1032 165141 1625 6113364634 13130 0ustar laufersnobody **Important**

    **Important**

    Local security measures

    There may be security measures or other authentication procedures in use at your site that prevent you from using the rcp command to copy files from one host to another.

    Check with your local system administrator to find out what the situation is on your system.


    [Home] [Search] [Index]
    local/restores.html100644 1032 165141 1446 6113364634 14213 0ustar laufersnobody Restoring accidentally deleted files

    Restoring accidentally deleted files

    It is possible to restore files and directories that have been deleted if a backup has been made.

    Contact your local system administrator for help.


    [Home] [Search] [Index]
    local/sysadm.html100644 1032 165141 1512 6115567454 13646 0ustar laufersnobody Contacting the system administrator

    Contacting the system administrator

    To contact the administrator for this system:

    Either

       * Email <put in address for this system>
    

    or

       * Phone <put in details for this organisation>
    

    [Home] [Search] [Index]
    local/getaccount.html100644 1032 165141 1243 6113364635 14475 0ustar laufersnobody Obtaining a username and password

    Obtaining a username and password

    Information for your local site should be placed here.


    [Home] [Search] [Index]
    mail/ 40755 1032 165141 0 6113364647 11211 5ustar laufersnobodymail/5.3.2.1.html100644 1032 165141 2056 6113364635 13000 0ustar laufersnobody Reading mail in your mbox file

    Reading mail in your mbox file

    When you quit the mail program , any messages that you have not explicitly saves ar deleted are automatically saved to the file mbox in your home directory.

    To read the messages stored in this file, start the mail program with the command:

       mail -f
    

    [Home] [Search] [Index]
    mail/5.3.2.2.html100644 1032 165141 1767 6113364635 13011 0ustar laufersnobody Reading mail stored in other files

    Reading mail stored in other files

    You can save mail messages in files that are located anywhere in your personal file system.

    To read files stored in these files, start the mail program with the command:

       mail -f filename
    

    [Home] [Search] [Index]
    mail/6.1.1.html100644 1032 165141 2320 6113364635 12631 0ustar laufersnobody Saving mail in folders

    Saving mail in folders

    You can customise the mail program so that all your mail files are automatically held in one directory. These files are known as folders.

    To do this:

    1. Create a directory to keep your mail folders in.
    2. Set the value of the environment variable folder to the pathname for this directory.

    To save a file to a folder in this directory, save the mail as usual, and append a + (plus sign) to the name of the file (folder) that the mail is to be stored in.


    [Home] [Search] [Index]
    mail/commands.html100644 1032 165141 3153 6115616560 13773 0ustar laufersnobody Commands available in send mode

    Commands available in send mode

    The following commands can be used while you are preparing a mail message in send mode.

    
    To ...                                          Do this
    
    
    cancel the mail message ~x preview the mail message ~p add users to the Cc: list ~c users add users to the Bcc: list ~b users display this list of commands ~? use the visual editor on your mail message ~v insert a file into the mail message ~r filename add your signature ~a or ~A add users to the To: list ~t users run a shell command ~! command include output from a shell command ~<! command

    [Home] [Search] [Index]
    mail/commandz.html100644 1032 165141 1616 6113364636 14006 0ustar laufersnobody Using UNIX shell commands

    Using UNIX shell commands

    To use a UNIX command while you are reading your mail use the command:

       ! command
    

    For example

       & ! rm tmp/card.ps
    

    This command removes the file card.ps from the directory tmp.


    [Home] [Search] [Index]
    mail/custom.html100644 1032 165141 2137 6152551124 13500 0ustar laufersnobody Customising the mail program

    Customising the mail program

    The mail program can be customised by setting variables in the .mailrc file in your home directory.

    Variables are set using the set command. Some variables have values assigned to them with the = (equals-sign).


    [Home] [Search] [Index]
    mail/custom1.html100644 1032 165141 1622 6113364636 13566 0ustar laufersnobody Setting the visual editor variable

    Setting the visual editor variable

    To use an editor to edit your mail message, set the variable VISUAL to the pathname of the editor that you want to use. For example:

       set VISUAL=/usr/ucb/vi
    

    This sets the VISUAL variable to the vi editor.


    [Home] [Search] [Index]
    mail/custom2.html100644 1032 165141 2136 6113364636 13570 0ustar laufersnobody Creating a signature

    Creating a signature

    To create a signature set the variables sign and Sign in the .mailrc file. For example:

       set sign='Lost in hyperspace'
    

    This creates the signature Lost in hyperspace that the user can add to the end of their mail messages.

       set Sign='Fax: +44 31 453 9732'
    

    This creates the signature Fax: +44 31 453 9732 that the user can add to the end of their mail messages.


    [Home] [Search] [Index]
    mail/custom3.html100644 1032 165141 2160 6113364636 13566 0ustar laufersnobody Using an alias

    Using an alias

    Using an alias as a mail address allows you to send a message to several people using only a single address.

    To create an alias, define it in the .mailrc file in your home directory. For example:

       alias unixteam keith@castle rob@tattoo\
       paul@castle tony@castle
    

    This creates a single alias for the addresses of four users. Using the alias unixteam as the mail address will send the message to each one of them.

    You can also use an alias within an alias, and so on!


    [Home] [Search] [Index]
    mail/files.html100644 1032 165141 2501 6113364636 13272 0ustar laufersnobody Mail program files

    Mail program files

    The mail program uses several files. They are:

    /usr/spoMail.rc

    The global start-up file from which the mail program gets its default values.

    ~username/.mailrc

    A personal start-up file in your home directory. You have to create this file and its contents.

    ~username/mbox

    The file in your home directory where your mail is stored once it has been read.

    ~username/dead.letter

    The file in your home directory where any mail message that you decide not to send is stored.


    [Home] [Search] [Index]
    mail/five.1.html100644 1032 165141 4164 6115616610 13261 0ustar laufersnobody Mail commands

    Mail commands

    These are the commands you can enter at the mail prompt to read and manage your mail.

    Type a ? at the command prompt whenever you want to dispay a list of them.

    
    To ...                                      Do this
    
    use a UNIX shell command ! command delete the current message d delete a specific message d message list undelete a specific message u message list save the current message s save a specific message s message list reply to sender of a message r message list reply to sender and all recipients R message list of a message read the current message <Return> read a specific message p message list show the top of a message top message list (default 5 lines) display next [previous] page of headers z [-] edit message with the visual editor v message list go to the next message and display it n save the current message s filename save a specific message s message list filename

    [Home] [Search] [Index]
    mail/five.2.1.html100644 1032 165141 1746 6113364637 13433 0ustar laufersnobody Using the biff utility

    Using the biff utility

    Check on the status of biff by entering the command:

       biff
    

    A y indicates that biff is already active; a n that biff is disabled.

    To activate biff put the line

       biff y
    

    in your .login file.


    [Home] [Search] [Index]
    mail/five.2.html100644 1032 165141 1544 6113364637 13270 0ustar laufersnobody Notification of mail arriving

    Notification of mail arriving

    When you login, the message

       You have mail
    

    indicates that there is mail for you.

    While you are logged on, use the biff utility to inform yourself that you have received new mail.


    [Home] [Search] [Index]
    mail/five.3.1.1.html100644 1032 165141 1712 6113364637 13564 0ustar laufersnobody Reading the top of each message

    Reading the top of each message

    To read the first few lines of a message use the command:

       t message list
    

    This displays the first five (5) lines of each message.

    You can get the mail program to display more or fewer lines by changing the topline variable.


    [Home] [Search] [Index]
    mail/five.3.1.html100644 1032 165141 1772 6115616644 13433 0ustar laufersnobody Reading commands

    Reading commands

    
    To ...                                    Command
    
    display the current message <Return> display message number n n display message for a specific user p user display next [previous] page of headers z [-] redisplay the mail headers h

    [Home] [Search] [Index]
    mail/five.3.2.html100644 1032 165141 2055 6113364637 13427 0ustar laufersnobody Reading other mail files

    Reading other mail files

    The command

       mail
    

    reads the mail that is in your system mailbox. This is a file named after your username that is normally in the directory /usr/spool/mail.

    There are other files where your mail can be kept and which you might want to read.


    [Home] [Search] [Index]
    mail/five.3.html100644 1032 165141 2172 6113364637 13267 0ustar laufersnobody Reading mail messages

    Reading mail messages

    To read your mail enter the command:

       mail
    

    A summary of your messages, made up of mail headers is displayed.

    At the bottom of the screen is the mail prompt "&" at which you enter the commands that allow you to read your mail.


    [Home] [Search] [Index]
    mail/five.4.1.html100644 1032 165141 2175 6113364637 13432 0ustar laufersnobody Exit mail using the "q" command

    Exit mail using the "q" command

    Using the q command tidies up your mailbox:

    1. Messages you have read are moved to a file called mbox in your home directory.
    2. Messages you have deleted are removed from your mailbox.
    3. Any messages that have not been read or deleted are retained in your mailbox and marked as unread.
    4. Messages that have been explicitly saved to a file other than mbox are deleted.

    [Home] [Search] [Index]
    mail/five.4.2.html100644 1032 165141 1444 6113364640 13423 0ustar laufersnobody Exit mail using the "x" command

    Exit mail using the "x" command

    Using the x command leaves your mailbox untouched:

    1. Messages that you have read will still be marked as unread.
    2. Messages marked for deletion will not be deleted.

    [Home] [Search] [Index]
    mail/five.4.html100644 1032 165141 1623 6113364640 13262 0ustar laufersnobody Exiting the mail program

    Exiting the mail program

    You can stop reading your mail and exit the mail program whenever you want.

    There are two ways that you can use to exit mail. Each has a slightly different effect.


    [Home] [Search] [Index]
    mail/5.1.1.html100644 1032 165141 1466 6113364640 12636 0ustar laufersnobody Message list

    Message list

    A message list consists of integers (0-9), a range of integers, or user names separated by spaces. If omitted, mail uses the current message. For example the command

       s 1-5
    

    saves messages 1 through 5.


    [Home] [Search] [Index]
    mail/five.html100644 1032 165141 1534 6113364640 13121 0ustar laufersnobody Receiving mail

    Receiving mail

    Select a topic for further information.


    [Home] [Search] [Index]
    mail/four.1.html100644 1032 165141 3323 6115616740 13303 0ustar laufersnobody Sending mail: the Basics

    Sending mail: the Basics

    Before sending mail for the first time, make sure that you understand how to give a mail address.

    1. Enter the command:

       mail username@address
    

    You will then be prompted to enter the subject of your mail message.

    2. Enter the subject title and press <Return>.

       Subject: subject_title
    

    If you make a mistake use the <Delete> key to backup and correct it.

    3. Enter the text of your message. Use the <Delete> key to backup and correct any typing mistakes. Press the <Return> key whenever you want to start a new line.

    4. To send the mail message press <Return> to start a new line and type a full stop. Press the <Return> key again.

    Your message will be sent and the shell prompt will be displayed.


    [Home] [Search] [Index]
    mail/four.2.html100644 1032 165141 2471 6113364641 13305 0ustar laufersnobody Cancelling a mail message

    Cancelling a mail message

    You can cancel sending a mail message using the commands ~x or ~q.

    The command ~x cancels the message you are sending and exits mail. It does not save the message you were composing.

    The command ~q cancels the message, saves it in the file dead.letter in your home directory, and then exits mail.

    The dead.letter file only keeps the most recently cancelled mail message. The next time you cancel a mail message, it will overwrite the contents of the dead.letter file.

    As with conventional mail, you cannot cancel a mail message which has already been sent. Be sure you mean what you say first time!


    [Home] [Search] [Index]
    mail/four.3.html100644 1032 165141 2105 6113364641 13300 0ustar laufersnobody Previewing a mail message

    Previewing a mail message

    To preview the mail message up to the point you are currently at, use the command ~p. For example:

       To get a demo copy of this do
       an ftp to the address above
       ~p
       -------
       Message contains:
       To: helper
       Subject: MetaCard
       I've just discovered this application. It's
       great!. It's available from MetaCard
       Corporation (ftp.metacard.com)
       To get a demo copy of this do
       an ftp to the address above[B
       (continue)
    	

    [Home] [Search] [Index]
    mail/four.4.html100644 1032 165141 1723 6115617004 13302 0ustar laufersnobody Sending a file in the mail

    Sending a file in the mail

    You can send the contents of a file as a mail message. For example:

       mail tony jane peter < memo
    

    This command mails the contents of the file memo to three users on the same system as the sender: tony, jane and peter.


    [Home] [Search] [Index]
    mail/four.5.1.html100644 1032 165141 2364 6115617063 13451 0ustar laufersnobody Using the editor

    Using the editor

    To use your normal editor within the mail program:

    1. Enter the mail command in the usual way.

    2. Enter the subject of the mail message.

    3. Call up the editor by entering the command ~v at the start of line.

      A file is automatically created in the directory /tmp to hold the contents of your message until it is sent.

    4. Use your editor in the usual way to compose the mail message.

    5. Exit the editor, saving the file in the usual way.

    6. Send the message by entering a full stop at the start of a new line and pressing the <Return> key.


    [Home] [Search] [Index]
    mail/four.5.html100644 1032 165141 1556 6113364641 13313 0ustar laufersnobody Preparing your mail using an editor

    Preparing your mail using an editor

    You can customise the mail program so that you can use your usual text editor within the mail program to create and edit your mail message.


    [Home] [Search] [Index]
    mail/four.6.1.html100644 1032 165141 1407 6113364641 13446 0ustar laufersnobody Using a mail command

    Using a mail command

    To insert a file into a mail message use the mail command:

       ~r filename
    

    [Home] [Search] [Index]
    mail/four.6.2.html100644 1032 165141 1655 6113364641 13454 0ustar laufersnobody Using an editor

    Using an editor

    1. Customise the mail program to use the editor of your choice.

    2. Use the editor's commands to insert the file at the point in the mail message where you want to include it.

      Both the vi and emacs editors provide this facility.


    [Home] [Search] [Index]
    mail/four.6.html100644 1032 165141 1437 6113364642 13313 0ustar laufersnobody Inserting files in mail

    Inserting files in mail

    There are two ways to insert a file into a mail message as you are composing it.


    [Home] [Search] [Index]
    mail/four.7.html100644 1032 165141 2147 6113364642 13313 0ustar laufersnobody Sending Cc: and Bcc: copies

    Sending Cc: and Bcc: copies

    To send a carbon copy of the mail message to other users use the command:

       ~c address1, address2, ...
    

    Make sure that each address is followed by a comma (,).

    To send a blind carbon copy of the mail message to another user, use the command:

       ~b address
    

    [Home] [Search] [Index]
    mail/four.8.html100644 1032 165141 1720 6115617107 13307 0ustar laufersnobody Using UNIX shell commands

    Using UNIX shell commands

    To use a UNIX command while you are preparing a mail message use the command:

       ~! command
    

    To include the output from a UNIX command into the mail message at this point, use the command:

       ~<! command
    

    [Home] [Search] [Index]
    mail/four.9.html100644 1032 165141 1617 6113364642 13316 0ustar laufersnobody Adding your signature

    Adding your signature

    Before adding a personal signature to mail, you will have to create a signature to use.

    To add your signature to the mail message, use either the command:

       ~a or ~A
    

    [Home] [Search] [Index]
    mail/four.html100644 1032 165141 2424 6113364642 13144 0ustar laufersnobody Sending mail

    Sending mail

    To get started using mail read the basics. Select other headings for further information about sending mail.


    [Home] [Search] [Index]
    mail/index.html100644 1032 165141 2515 6113364642 13301 0ustar laufersnobody Using Electronic Mail

    Using Electronic Mail

    Every UNIX system allows you to exchange electronic mail with other users on your local system. Most systems also allow you to exchange mail with users on remote systems.

    Electronic mail is very quick. Messages will reach users on the same system almost immediately; users on systems elsewhere in this country, or other countries, in a few minutes, or hours at most.


    [Home] [Search] [Index]
    mail/modes.html100644 1032 165141 2133 6113364643 13276 0ustar laufersnobody Mail program modes

    Mail program modes

    When you are using the mail program you are in one or the other of its modes.

    If you are using the mail program to read and manage your mail, it is in command mode. There are a number of commands that you can use in this mode.

    If you are using mail to write and send a mail message, it is in send mode. There are a number of commands that you can use in this mode.


    [Home] [Search] [Index]
    mail/other.html100644 1032 165141 1704 6113364643 13313 0ustar laufersnobody Other mail programs

    Other mail programs

    There are many other mail programs available for UNIX systems. Check with your system administrator to see if any of them are available on this system.

    Here are a selection of the most popular UNIX mailers:

    • Elm - screen based mailer
    • Pine - menu based mailer

    [Home] [Search] [Index]
    mail/preset.html100644 1032 165141 2154 6113364643 13474 0ustar laufersnobody Displaying preset variables

    Displaying preset variables

    Your system administrator may have customised the mail program for you. The system wide default values are in the file /usr/lib/Mail.rc.

    Check which variables are already set before making changes of your own.

    If you are in command mode, enter the command:

       set
    

    If you are composing a mail message, enter the command:

       ~:set
    

    This displays a list of variables that are currently set, and their values.


    [Home] [Search] [Index]
    mail/six.1.html100644 1032 165141 2001 6113364643 13123 0ustar laufersnobody Saving mail messages

    Saving mail messages

    To save a message (or messages) to a file enter the command:

       s message list filename
    

    Organise your mail by saving it in files according to its subject or sender.


    [Home] [Search] [Index]
    mail/six.2.1.html100644 1032 165141 2003 6113364643 13265 0ustar laufersnobody Undeleting messages

    Undeleting messages

    The delete command only marks messages for deletion.

    Messages are only deleted once you leave the mail program, or switch to reading mail from another mail file. Until then you can cancel any delete command with the undelete command.

    The format of the command is:

       u message list
    

    [Home] [Search] [Index]
    mail/six.2.html100644 1032 165141 2050 6113364643 13130 0ustar laufersnobody Deleting mail messages

    Deleting mail messages

    To delete a message (or messages) from the mail folder that you are currently reading, enter the command:

       d message list
    

    Messages are not deleted until you quit using the mail program. If you exit the mail program they are not deleted.


    [Home] [Search] [Index]
    mail/six.3.1.html100644 1032 165141 1762 6113364643 13301 0ustar laufersnobody Reply to sender only

    Reply to sender only

    To reply only to the person who originally sent you the mail message, use the command:

       R message list
    

    You would use this command where the mail message had been carbon copied to several other people, but you only wanted the original sender to see your reply.


    [Home] [Search] [Index]
    mail/six.3.2.html100644 1032 165141 1754 6113364644 13304 0ustar laufersnobody Reply to all recipients

    Reply to all recipients

    To send a reply to all the people who have been sent a copy of this message, use the command:

       r message list
    

    You would use this command where the mail message had been carbon copied to several other people, and you wanted everyone to see your reply to it.


    [Home] [Search] [Index]
    mail/six.3.html100644 1032 165141 1467 6113364644 13145 0ustar laufersnobody Replying to mail messages

    Replying to mail messages

    There are two ways in which you can reply to a mail message: use whichever is most appropriate.


    [Home] [Search] [Index]
    mail/six.html100644 1032 165141 1631 6113364644 12775 0ustar laufersnobody Managing mail

    Managing mail

    Select a topic for further information.


    [Home] [Search] [Index]
    mail/three.1.html100644 1032 165141 4032 6113364644 13436 0ustar laufersnobody Network domains and mail addresses

    Network domains and mail addresses

    Large networks may have thousands of systems connected to them. A domain name addressing scheme is used to specify system addresses in a way that humans can understand.

    The top level domain for the UK is uk. This domain has several sub-domains: ac (for academic) and co (for commercial).

    The ac domain has many sub-domains, based on the name of the organisations within it. The sub-domain for the University of Hull for example is hull.

    If the organisation has a large number of systems, then the organisational domain might also contain sub-domains, each of which contains a number of systems. This is often done on a departmental or service basis.

    The mail address for any system can be given as a series of domains, each of which is separated by a dot (full stop).

    For example, the full mail address to a user on a particular system might look like this:

       john@ubik.ucs.ed.ac.uk
    

    Reading from left to right, this is the mail address for the user known as john on the system called ubik. This system is in the organisational sub-domain ucs, (University Computing Service) which is in the organisational domain ed (Edinburgh).

    This organisation is located in the ac (academic domain) for the national domain uk (United Kingdom).


    [Home] [Search] [Index]
    mail/three.2.html100644 1032 165141 2224 6113364645 13441 0ustar laufersnobody Mail addresses on the Internet

    Mail addresses on the Internet

    Internet mail addresses use what is known as "little endian" notation, with the bottom domain given first. For example:

       joe@ubik.cs.ed.ac.uk
    

    The UK academic community used to give their addresses in JANET notation, with the order of domains reversed. This format is now outdated and should not be used.

    Your mail program might be configured to handle mail addresses given in other notations. Check with your system administrator for further information.


    [Home] [Search] [Index]
    mail/three.3.html100644 1032 165141 3120 6113364646 13437 0ustar laufersnobody Finding a person's mail address

    Finding a person's mail address

    Electronic mail programs do not provide you with the equivalent to a telephone directory: there is no way that you can look up a person's electronic mail address.

    Many people now include their email address on their business stationery. And of course you can always ask them for it.

    The "header" of any mail that you receive will contain the email address of the person who sent it, in the From:field. For example:

       Date:     Tue, 18 Aug 92 12:15:17 WET DST
       From:     tony@bigfish.com
       Subject:  Xgator troubles
       To:       john@castle.ed.ac.uk
    

    Each domain has a "postmaster" who will try to supply you with a mail address if asked. For example:

       From:     john@ed.ac.uk
       Subject:  Address please
       To:       postmaster@durham
       Please provide the email address for Dr J.R.
       Dozer who is a member of staff in the Psychology
       Dept.
       Thankyou
    

    [Home] [Search] [Index]
    mail/three.4.html100644 1032 165141 1571 6113364646 13450 0ustar laufersnobody Electronic mail directories

    Electronic mail directories

    This is not strictly true. The system you are using might have a locally written program that allows you to search for a name in a local mail directory.

    Check with your system administrator to see if this facility is available at your site.


    [Home] [Search] [Index]
    mail/three.6.html100644 1032 165141 2004 6113364647 13443 0ustar laufersnobody Creating a distribution list

    Creating a distribution list

    A distribution list is very useful where a group of users need to communicate amongst themselves on a regular basis.

    Each list is given a name just like any other user. By addressing a message to the list name, the sender can be sure that everyone will receive a copy.

    You cannot set up a distribution list yourself. Ask your system administrator to set one up for you.


    [Home] [Search] [Index]
    mail/three.html100644 1032 165141 2364 6113364647 13310 0ustar laufersnobody Addressing mail

    Addressing mail

    You have to provide the mail system with an address for it to deliver the mail to. The syntax of any mail address is either:

       username
    

    or:

       username@system-name
    

    [Home] [Search] [Index]
    mail/two.html100644 1032 165141 2346 6113364647 13012 0ustar laufersnobody About the mail program

    About the mail program

    The mail program described here is known as mail (or ucb/mail) and is available on many systems. Some systems provide a similar mail program called mailx which is an improved version of mail. If necessary, use the command mailx instead of mail.

    Most mail programs work in a similar manner, so you will find the information on using mail useful when you come to use some other mailer.


    [Home] [Search] [Index]
    mail/pine.html100644 1032 165141 2556 6113364647 13137 0ustar laufersnobody Pine

    Pine

    pine is a mail program developed at the University of Washington. It has easy-to-remember single character commands and a menu interface which displays those available at each point.

    You might choose to use pine if you like learning new tools by exploration rather than reading a manual. The menu system is designed to handle mistakes by new users, and the on-line help system offers advice specific to whatever screen you are currently viewing.

    Start using pine with the command:

       pine
    

    You may also find pine to be helpful if you wish to use more than one mailbox to manage your electronic mail.


    [Home] [Search] [Index]
    mail/elm.html100644 1032 165141 2332 6113364650 12743 0ustar laufersnobody Elm

    Elm

    elm was initially developed to provide a full-screen mail program when only simple line-based ones were available. Since then it has grown and become established among the Unix community. Unlike mail which works mostly with one line at a time, elm takes advantage of the entire terminal screen for listing mail received and editing messages.

    Start using elm with the command:

       elm
    

    Pine takes much the same approach as elm and is more sophisticated.


    [Home] [Search] [Index]
    manual/ 40755 1032 165141 0 6113364653 11541 5ustar laufersnobodymanual/4.1.10.html100644 1032 165141 1352 6113364650 13243 0ustar laufersnobody DIAGNOSTICS

    DIAGNOSTICS

    This section explains the meaning of the various diagnostic messages that the command may present you with. Messages that are considered self explanatory are not included.


    [Home] [Search] [Index]
    manual/4.1.11.html100644 1032 165141 1175 6113364650 13247 0ustar laufersnobody BUGS

    BUGS

    This section advises you about known 'bugs' or shortcomings with the command.


    [Home] [Search] [Index]
    manual/4.1.2.html100644 1032 165141 2517 6113364651 13171 0ustar laufersnobody SYNOPSIS

    SYNOPSIS

    This section gives a summary of command usage. It enables you to see how options can be given to the command. For example:

       cp [-iprR] directory1 directory2
    

    The first word or consecutive characters are the name of the command.

    The characters enclosed in [square brackets] are optional. A '-' (hyphen) preceding a character indicates that this is an option that can be applied to the command.

    Options grouped together after a single hyphen, like this, [-abcD] can be used in this format. If they are given separately, like this, [-n] [-r] [-Z] then they must be used in this format.

    Arguments are represented by a name such as file, filename or directory.


    [Home] [Search] [Index]
    manual/4.1.3.html100644 1032 165141 1342 6113364651 13165 0ustar laufersnobody DESCRIPTION

    DESCRIPTION

    This section gives a detailed description of how the command works. For some commands this section consists of a few lines; for others it can be several pages long.


    [Home] [Search] [Index]
    manual/4.1.4.html100644 1032 165141 1206 6113364651 13165 0ustar laufersnobody OPTIONS

    OPTIONS

    This section explains the action that each option has when used with the command.


    [Home] [Search] [Index]
    manual/4.1.5.html100644 1032 165141 1264 6113364651 13172 0ustar laufersnobody ENVIRONMENT

    ENVIRONMENT

    This section gives the names of any environment variables used by the command and the value(s) that they can be set to.


    [Home] [Search] [Index]
    manual/4.1.6.html100644 1032 165141 1223 6113364651 13166 0ustar laufersnobody EXAMPLES

    EXAMPLES

    This section provides you with examples of how the command can be used. It is often omitted.


    [Home] [Search] [Index]
    manual/4.1.7.html100644 1032 165141 1155 6113364651 13173 0ustar laufersnobody FILES

    FILES

    This section gives details of the files used by the command.


    [Home] [Search] [Index]
    manual/4.1.8.html100644 1032 165141 1340 6113364651 13170 0ustar laufersnobody SEE ALSO

    SEE ALSO

    This section refers you to the manual page for commands that contain related information. Follow these references to learn which commands are associated with each other.


    [Home] [Search] [Index]
    manual/4.1.9.html100644 1032 165141 1217 6113364652 13175 0ustar laufersnobody WARNINGS

    WARNINGS

    This section warns you against using the command in a way that might cause you problems.


    [Home] [Search] [Index]
    manual/index.html100644 1032 165141 2355 6113364652 13637 0ustar laufersnobody Look-up Online Manual

    Look-up Online Manual

    The command man gives you access to an on-line manual containing a complete description of every command available on this system.

    man can also provide you with one line descriptions of commands specified by name; or for all commands whose description contains any of a set of keywords.


    [Home] [Search] [Index]
    manual/man_org.html100644 1032 165141 2051 6113364652 14143 0ustar laufersnobody Understanding the organisation of the manual

    Understanding the organisation of the manual

    The manual is organised into several sections each of which covers a different area.

    On some systems the command

       man section_number intro
    

    displays a manual page giving an overview of that section of the manual.


    [Home] [Search] [Index]
    manual/man_org2.html100644 1032 165141 1713 6113364652 14231 0ustar laufersnobody Searching by keyword

    Searching by keyword

    The command

       man -k keyword
    

    displays a one line synopsis of each command that has "keyword" in its description.

    Enclose a "phrase" in single quotes to search for it.

       man -k 'phrase_to_search_for'
    

    [Home] [Search] [Index]
    manual/man_org3.html100644 1032 165141 1732 6113364652 14233 0ustar laufersnobody Checking the description of a command

    Checking the description of a command

    To check what a command does:

       whatis name_of_command
    

    This displays the description for the command that is given in its online manual page.

    Get more information on the command with the man command.


    [Home] [Search] [Index]
    manual/man_org4.1.html100644 1032 165141 2522 6113364652 14371 0ustar laufersnobody Manual page headings

    Manual page headings

    These are the headings used to organise the content of the manual page for a command. A manual page may not contain information under every heading but the NAME, SYNOPSIS and DESCRIPTION are available for every command.

    Click on a heading for an explanation of its purpose.


    [Home] [Search] [Index]
    manual/man_org4.html100644 1032 165141 1734 6113364652 14236 0ustar laufersnobody Viewing manual pages

    Viewing manual pages

    To view the manual page for a command enter:

       man name_of_command
    

    The content of every man page is organised under a number of headings.


    [Home] [Search] [Index]
    manual/man_org5.html100644 1032 165141 1775 6113364653 14245 0ustar laufersnobody Printing manual pages

    Printing manual pages

    To print a copy of the manual page to a high quality PostScript printer:

       man -t name_of_command
    

    To print a copy of a manual page on a line printer:

       man name_of_command | lpr name_of_printer
    

    [Home] [Search] [Index]
    manual/4.1.1.html100644 1032 165141 1256 6113364653 13171 0ustar laufersnobody NAME

    NAME

    This lists the exact name of the command(s) covered by this manual page and gives a short description of what the command does.


    [Home] [Search] [Index]
    networks/ 40755 1032 165141 0 6113364654 12141 5ustar laufersnobodynetworks/rhosts.html100644 1032 165141 2711 6113364653 14446 0ustar laufersnobody Preventing password prompting

    Preventing password prompting

    You can avoid being prompted for your password whenever you rlogin to your account on a remote system. To do this:

    1. Login to the remote system using rlogin.

    2. Use an editor to create a file .rhosts.

    3. Edit this file so that it contains entries for the other remote systems that you have accounts on. Each entry is a line consisting of the name of the remote system followed by a space and your username on that system.

    4. Save the file to your home directory.

    5. Check that the access permission for this file prevents other users from writing to it.


    [Home] [Search] [Index]
    networks/rlogin.html100644 1032 165141 2143 6113364653 14415 0ustar laufersnobody Logging in using rlogin

    Logging in using rlogin

    To login to your account on a remote system use the command:

       rlogin remote_system_name
    

    To login to a remote system using a different username, use the command:

       rlogin remote_system_name -l username
    

    You are prompted for the password to your account on that system.


    [Home] [Search] [Index]
    networks/telnet.html100644 1032 165141 2360 6113364653 14417 0ustar laufersnobody Logging in using telnet

    Logging in using telnet

    telnet enables you to connect your terminal to another remote system. To login to your account on a remote system use the command:

       telnet remote_system_name
    

    You are prompted for your username and password for your account on the remote system. Once you are logged in, you can begin to issue commands on the remote system.


    [Home] [Search] [Index]
    networks/telnet2.html100644 1032 165141 1742 6115617160 14500 0ustar laufersnobody Using telnet in session mode

    Using telnet in session mode

    To login to several remote hosts, one after the other, use a telnet "session". To do this enter the command:

       telnet
       telnet>
    

    The telnet> prompt is displayed and you can enter commands to manage sessions on other hosts.


    [Home] [Search] [Index]
    networks/www.html100644 1032 165141 2001 6115063076 13735 0ustar laufersnobody telnet access to the World Wide Web

    telnet access to the World Wide Web

    The WorldWideWeb (W3) is a wide area hypermedia information retrieval initiative aiming to give universal access to a large universe of documents.

    To try out a simple terminal interface to W3, open a telnet connection to the host

       telnet.w3.org
    

    with the username

       www
    

    No password is required.


    [Home] [Search] [Index]
    networks/index.html100644 1032 165141 1655 6113364654 14242 0ustar laufersnobody Logging in to remote systems

    Logging in to remote systems

    There may be several UNIX systems at your site connected together by a network. If you have accounts on these remote systems you can login to them from the system you are currently using.


    [Home] [Search] [Index]
    problems/ 40755 1032 165141 0 6113364654 12110 5ustar laufersnobodyproblems/link.html100644 1032 165141 2376 6113364654 14040 0ustar laufersnobody Problems linking files

    Problems linking files

    filename : Cross-device link

    The file you are trying to make a link to is located on a different physical device. The solution is to create a symbolic link.


    directory_name is a directory

    You are trying to make a link to a directory. Check the pathname for the file.


    ln: filename : File exists

    A file with the same name as the linkname already exists in the destination directory. Use a different name for the linkname.


    [Home] [Search] [Index]
    problems/index.html100644 1032 165141 2756 6113364654 14214 0ustar laufersnobody Problems copying files

    Problems copying files

    cp: file pathname: Permission denied

    Either the access permissions for this file do not permit you to copy it or the access permissions for the destination directory do not allow you to copy files into it.


    cp: file_pathname: Is a directory (not copied).

    You have tried to copy a directory.


    cp: file pathname: No such file or directory

    The file (or directory) that you have tried to copy does not exist.


    Usage: cp [-ip] f1 f2; or: cp [-ipr] f1 ... fn d2

    You have forgotten to specify the destination file (or directory).


    [Home] [Search] [Index]
    scrpt/ 40755 1032 165141 0 6113364666 11423 5ustar laufersnobodyscrpt/scrpt1.1.html100644 1032 165141 1455 6113364655 13764 0ustar laufersnobody Creating the shell script

    Creating the shell script

    To create a script use a text editor to create a new file containing the commands that you want the script to execute.


    [Home] [Search] [Index]
    scrpt/scrpt1.2.2.html100644 1032 165141 2324 6113364655 14121 0ustar laufersnobody Example of using a shell script

    Example of using a shell script

    To make a file containing a shell script executable and then run the script:

       display
       display: execute permission denied
       chmod u+x display
       display
       Date and time is:
       Mon Mar  8 10:51:17 GMT 1993
       Your username is: erpl08
       Your current directory is: /home/erpl08/scripts
    

    The command display does not run the script as the user does not have execute permission for the file. They give themselves execute permission and then re-enter the command to run the script.


    [Home] [Search] [Index]
    scrpt/scrpt1.2.3.html100644 1032 165141 2441 6113364655 14122 0ustar laufersnobody Problems running shell scripts

    Problems running shell scripts

    command_name: command not found

    Your shell's search path does not include the directory that the shell script is stored in. Move the file containing the shell script to the directory $HOME/bin. This directory is usually in your default search path.

    various messages

    There are errors in the construction and syntax of the shell script. Read through your script checking its logical operations and the commands that it uses.

    You can also use command line options to debug your script.


    [Home] [Search] [Index]
    scrpt/scrpt1.2.4.html100644 1032 165141 1467 6113364655 14132 0ustar laufersnobody Using the Bourne shell to interpret a shell script

    Using the Bourne shell to interpret a shell script

    To make sure that your shell script is always run from a standard Bourne shell have the line

       #!/bin/sh
    

    as the first line of the script.


    [Home] [Search] [Index]
    scrpt/scrpt1.2.html100644 1032 165141 3235 6113364655 13763 0ustar laufersnobody Executing a shell script

    Executing a shell script

    Before using a file as a shell script you must change its access permissions so that you have execute permission on the file, otherwise the error message Permission deniedis displayed.

    To run the shell script, simply type its name at the prompt. The commands in the script will then execute one at a time as though you were typing them in at the terminal.

    To give yourself execute permission for the file containing the script use the command:

       chmod u+rwx filename
    

    The +rwx after the u allows you to read, write to and execute the script: no one else has permission to read, write or execute.

    To give other users permission to read and execute but not alter the shell script use:

       chmod go+rx filename
    

    [Home] [Search] [Index]
    scrpt/scrpt1.html100644 1032 165141 1670 6113364655 13624 0ustar laufersnobody Creating and executing simple shell scripts

    Creating and executing simple shell scripts

    To create a simple shell script, you can put command lines into a file, set the proper access permissions and then execute the file.


    [Home] [Search] [Index]
    scrpt/scrpt1a.html100644 1032 165141 3601 6113364655 13761 0ustar laufersnobody Example of a simple shell script

    Example of a simple shell script

    These are the contents of a shell script called display:

       cat display
       # This script displays the date, time, username and
       # current directory.
       echo "Date and time is:"
       date
       echo
       echo "Your username is: `whoami` \\n"
       echo "Your current directory is: \\c"
       pwd
    

    The first two lines beginning with a hash (#) are comments and are not interpreted by the shell. Use comments to document your shell script; you will be surprised how easy it is to forget what your own programs do!

    The backquotes (`) around the command whoami illustrate the use of command substitution.

    The \\n is an option of the echo command that tells the shell to add an extra carriage return at the end of the line. The \\c tells the shell to stay on the same line. See the man page for details of other options.

    The argument to the echo command is quoted to prevent the shell interpreting these commands as though they had been escaped with the \\ (backslash) character.


    [Home] [Search] [Index]
    scrpt/scrpt2.1.2.html100644 1032 165141 3072 6113364656 14123 0ustar laufersnobody Examples of passing arguments to the shell

    Examples of passing arguments to the shell

    To pass several arguments from the command line to the shell:

       cat first_5args
       # This script echoes the first five arguments
       # supplied to the script
       echo The first five command line
       echo arguments are $1 $2 $3 $4 $5
       first_5args mines a pint john o.k.
       The first five command line
       arguments are mines a pint john o.k.
    

    This passes the arguments represented by parameters $1 through $5 to the shell script.


    To pass the value of each positional parameter to the shell script:

       cat printps
       # This script converts ASCII files to PostScript
       # and sends them to the PostScript printer ps1
       # It uses a local utility "a2ps"
       a2ps $* | lpr -Pps1
       printps elm.txt vi.ref msg
    

    This processes the three files given as arguments to the command printps.


    [Home] [Search] [Index]
    scrpt/scrpt2.1.3.1.html100644 1032 165141 2223 6113364656 14260 0ustar laufersnobody Example of using the shift command

    Example of using the shift command

    To successively shift the argument that is represented by each positional parameter:

       cat shift_demo
       #!/bin/sh
       echo "arg1=$1 arg2=$2 arg3=$3"
       shift
       echo "arg1=$1 arg2=$2 arg3=$3"
       shift
       echo "arg1=$1 arg2=$2 arg3=$3"
       shift
       echo "arg1=$1 arg2=$2 arg3=$3"
       shift_demo one two three four five six seven
       arg1=one arg2=two arg3=three
       arg1=two arg2=three arg3=four
       arg1=three arg2=four arg3=five
       arg1=four arg2=five arg3=six
       arg1=five arg2=six arg3=seven
    

    [Home] [Search] [Index]
    scrpt/scrpt2.1.3.html100644 1032 165141 2413 6113364656 14122 0ustar laufersnobody Using the shift command

    Using the shift command

    Usually only nine command line arguments can be accessed using positional parameters. The shift command gives access to command line arguments greater than nine by shifting each of the arguments.

    The second argument ($2) becomes the first ($1), the third ($3) becomes the second ($2) and so on. This gives you access to the tenth command line argument by making it the ninth. The first argument is no longer available.

    Successive shift commands make additional arguments available. Note that there is no "unshift" command to bring back arguments that are no longer available!


    [Home] [Search] [Index]
    scrpt/scrpt2.1.html100644 1032 165141 3472 6113364656 13767 0ustar laufersnobody Passing arguments to the shell

    Passing arguments to the shell

    Shell scripts can act like standard UNIX commands and take arguments from the command line.

    Arguments are passed from the command line into a shell program using the positional parameters $1 through to $9. Each parameter corresponds to the position of the argument on the command line.

    The positional parameter $0 refers to the command name or name of the executable file containing the shell script.

    Only nine command line arguments can be accessed, but you can access more than nine using the shift command.

    All the positional parameters can be referred to using the special parameter $*. This is useful when passing filenames as arguments. For example:

       cat printps
       # This script converts ASCII files to PostScript
       # and sends them to the PostScript printer ps1
       # It uses a local utility "a2ps"
       a2ps $* | lpr -Pps1
       printps elm.txt vi.ref msg
    

    This processes the three files given as arguments to the command printps.


    [Home] [Search] [Index]
    scrpt/scrpt2.10.html100644 1032 165141 2204 6113364656 14037 0ustar laufersnobody Getting further information

    Getting further information

    You can get more information from the manual page for the Bourne shell (sh).

    To get information about shell programming with another shell, read the manual page for that shell. For example:

       man ksh
    

    This will display the manual page for the Korn shell.

    There are a number of books on the different shells and how to program them. Many will be stocked in the computer section of most major booksellers. Or they may be available through your library.


    [Home] [Search] [Index]
    scrpt/scrpt2.2.1.html100644 1032 165141 2637 6113364656 14131 0ustar laufersnobody Examples of environment variable names

    Examples of environment variable names

    HOME

    this is the pathname of your "home" directory when you login and to which cd changes when invoked with no argument.

    PATH

    defines the directories searched when the shell is looking for the file to execute when processing a command.

    MAIL

    if set to the name of a mail file the shell will inform you of the arrival of new mail.

    PS1

    contains the shell prompt string.

    PS2

    is the continuation prompt when a command spans more than one line.

    IFS (Internal Field Separator)

    The set of characters used for blank interpretation in the shell. Normally space, TAB and newline.


    [Home] [Search] [Index]
    scrpt/scrpt2.2.2.html100644 1032 165141 4335 6113364656 14127 0ustar laufersnobody Special shell variables

    Special shell variables

    There are some variables which are set internally by the shell and which are available to the user:

    
    Name          Description
    
    $1 - $9 these variables are the positional parameters. $0 the name of the command currently being executed. $# the number of positional arguments given to this invocation of the shell. $? the exit status of the last command executed is given as a decimal string. When a command completes successfully, it returns the exit status of 0 (zero), otherwise it returns a non-zero exit status. $$ the process number of this shell - useful for including in filenames, to make them unique. $! the process id of the last command run in the background. $- the current options supplied to this invocation of the shell. $* a string containing all the arguments to the shell, starting at $1. $@@ same as above, except when quoted.

    Notes

    $* and $@@ when unquoted are identical and expand into the arguments.

    "$*" is a single word, comprising all the arguments to the shell, joined together with spaces. For example '1 2' 3 becomes "1 2 3".

    "$@@" is identical to the arguments received by the shell, the resulting list of words completely match what was given to the shell. For example '1 2' 3 becomes "1 2" "3"


    [Home] [Search] [Index]
    scrpt/scrpt2.2.3.html100644 1032 165141 2727 6113364657 14134 0ustar laufersnobody Evaluating shell variables

    Evaluating shell variables

    The following set of rules govern the evaluation of all shell variables.

    
    Definition            Description
    
    $var signifies the value of var or nothing, if var is undefined. ${var} same as above except the braces enclose the name of the variable to be substituted. ${var-thing} value of var if var is defined; otherwise thing. $var is not set to thing. ${var=thing} value of var if var is defined; otherwise thing. If undefined $var is set to thing. ${var?message} If defined, $var; otherwise print message and exit the shell. If the message is empty, print a standard message. ${var+thing} thing if $var is defined, otherwise nothing.

    [Home] [Search] [Index]
    scrpt/scrpt2.2.html100644 1032 165141 2245 6113364657 13766 0ustar laufersnobody Handling shell variables

    Handling shell variables

    The shell has several variables which are automatically set whenever you login.

    The values of some of these variables are stored in names which collectively are called your user environment.

    Any name defined in the user environment, can be accessed from within a shell script. To include the value of a shell variable into the environment you must export it.


    [Home] [Search] [Index]
    scrpt/scrpt2.3.html100644 1032 165141 2505 6113364657 13766 0ustar laufersnobody Reading user input

    Reading user input

    To read standard input into a shell script use the read command. For example:

       echo "Please enter your name:"
       read name
       echo "Welcome to Edinburgh $name"
    

    This prompts the user for input, assigns this to the variable name and then displays the value of this variable to standard output.

    If there is more than one word in the input, each word can be assigned to a different variable. Any words left over are assigned to the last named variable. For example:

       echo "Please enter your surname\n"
       echo "followed by your first name: \c"
       read name1 name2
       echo "Welcome to Glasgow $name2 $name1"
    

    [Home] [Search] [Index]
    scrpt/scrpt2.4.1.2.html100644 1032 165141 2741 6115617246 14265 0ustar laufersnobody Example of using an if construct

    Example of using an if construct

    To carry out a conditional action:

       if who | grep -s keith > /dev/null
       then
       echo keith is logged in
       else
       echo keith not available
       fi
    

    This lists who is currently logged on to the sytem and pipes the output through grep to search for the username keith.

    The -s option causes grep to work silently and any error messages are directed to the file /dev/null instead of the standard output.

    If the command is succesful i.e. the username keith is found in the list of users currently logged in then the message

       keith is logged on
    

    is displayed, otherwise the second message is displayed.


    [Home] [Search] [Index]
    scrpt/scrpt2.4.1.html100644 1032 165141 2766 6113364657 14137 0ustar laufersnobody The if statement

    The if statement

    The if statement uses the exit status of the given command and conditionally executes the statements following. The general syntax is:

       if test
       then
          commands     (if condition is true)
       else
          commands     (if condition is false)
       fi
    

    then, else and fi are shell reserved words and as such are only recognised after a newline or ; (semicolon). Make sure that you end each if construct with a fi statement.

    if statements may be nested:

       if ...
       then ...
       else if ...
           ...
         fi
       fi
    

    The elif statement can be used as shorthand for an else if statement. For example:

       if ...
       then ...
       elif ...
         ...
       fi
    

    [Home] [Search] [Index]
    scrpt/scrpt2.4.2.1.html100644 1032 165141 3112 6170465642 14260 0ustar laufersnobody Example of using the && operator

    Example of using the && operator

    To notify the user about the outcome of a previous command:

       cat deliver
       #!/bin/sh
       # usage: deliver username  filename
       { cat $2 | write $1 ; } && echo done
    

    The user types a command such as:

       deliver keith greeting
    

    The first command { cat $2 | write $1 ; } concatenates and displays the message held in the file greeting and pipes the output through the write command whose argument is the name of the user to whom the message is to be sent.

    Note the use of the positional parameters $1 and $2. The ; (semicolon) is needed to sequentially execute the preceeding pipeline.

    If this command is successful, the message done is displayed on standard output.


    [Home] [Search] [Index]
    scrpt/scrpt2.4.2.html100644 1032 165141 2100 6113364660 14110 0ustar laufersnobody The && operator

    The && operator

    You can use the && operator to execute a command and, if it is successful, execute the next command in the list. For example:

       cmd1 && cmd2
    

    cmd1 is executed and its exit status examined. Only if cmd1 succeeds is cmd2 executed. This is a terse notation for:

       if cmd1 
       then
         cmd2
       fi
    

    [Home] [Search] [Index]
    scrpt/scrpt2.4.3.1.html100644 1032 165141 2417 6113364660 14263 0ustar laufersnobody Example of using the || operator

    Example of using the || operator

    To send a message to a user using the appropriate utility:

       cat writemail
       #!/bin/sh
       # usage: writemail user message
       echo "$2" |{ write "$1" || mail "$1" ;} 
    

    The user types a command such as:

       writemail sarah 'call me'
    

    The message entered by the user is piped through the command { write "$1" || mail "$1" ; }.

    If the the message cannot be sent to the user's terminal (they are not logged on) with the command write "$1" then the message is sent to the user by mail.


    [Home] [Search] [Index]
    scrpt/scrpt2.4.3.html100644 1032 165141 2133 6113364660 14117 0ustar laufersnobody The || operator

    The || operator

    You can use the || operator to execute a command and, if it fails, execute the next command in the command list. For example:

       cmd1 || cmd2
    

    cmd1 is executed and its exit status examined. If cmd1fails then cmd2 is executed. This is a terse notation for:

       cmd1
       if 	test $? -ne 0
       then
         cmd2 
       fi
    

    [Home] [Search] [Index]
    scrpt/scrpt2.4.html100644 1032 165141 2020 6113364660 13751 0ustar laufersnobody Conditional statements

    Conditional statements

    Every Unix command returns a value on exit which the shell can interrogate. This value is held in the read-only shell variable $?.

    A value of 0 (zero) signifies success; anything other than 0 (zero) signifies failure.


    [Home] [Search] [Index]
    scrpt/scrpt2.5.html100644 1032 165141 2461 6113364660 13763 0ustar laufersnobody Testing for files and variables with the test command

    Testing for files and variables with the test command

    The shell uses a command called test to evaluate conditional expressions. Full details of this command can be found in the test manual page. For example:

       if test ! -f $FILE
       then
         if test "$WARN" = "yes"
         then
           echo "$FILE does not exist"
         fi
       fi
    

    First, we test to see if the filename specified by the variable $FILE exists and is a regular file. If it does not then we test to see if the variable $WARN is assigned the value yes, and if it is a message that the filename does not exist is displayed.


    [Home] [Search] [Index]
    scrpt/scrpt2.6.1.1.html100644 1032 165141 2773 6113364660 14270 0ustar laufersnobody Example of using the case statement

    Example of using the case statement

    To specify an action when a word matches the pattern:

       cat diary
       #!/bin/sh
       today=`date +%m/%d`	(presents the date in the format 01/31)
       case	$today  in
       07/18)	echo	"Aonoch Mhor"
       ;;
       07/21)	echo	"Ben Wyvis"
       ;;
       08/02)	echo	"Buicheille Etive Mhor"
       ;;
       08/03)	echo	"Slioch"
       ;;
       *)		echo	"Wet..low level today"
       esac
       date +%m/%d
       07/18
       diary
       Aonoch Mhor 
    

    The value for the word $today is generated by the date command. This is then compared with various patterns so that the appropriate commands are executed.

    Note the use of the pattern *, this can be used to specify default patterns as the * character is the shell wildcard character.


    [Home] [Search] [Index]
    scrpt/scrpt2.6.1.html100644 1032 165141 3676 6113364660 14134 0ustar laufersnobody The case statement

    The case statement

    case is a flow control construct that provides for multi-way branching based on patterns.

    Program flow is controlled on the basis of the wordgiven. This word is compared with each pattern in order until a match is found, at which point the associated command(s) are executed.

       case word in
       pattern1) command(s)
       ;;
       pattern2) command(s)
       ;;
       patternN) command(s)
       ;;
       esac
    

    When all the commands are executed control is passed to the first statement after the esac. Each list of commands must end with a double semi-colon (;;).

    A command can be associated with more than one pattern. Patterns can be separated from each other by a | symbol. For example:

       case word in
       pattern1|pattern2) command
       ...					;;
    

    Patterns are checked for a match in the order in which they appear. A command is always carried out after the first instance of a pattern.

    The * character can be used to specify a default pattern as the * character is the shell wildcard character.


    [Home] [Search] [Index]
    scrpt/scrpt2.6.2.1.html100644 1032 165141 4376 6115617314 14271 0ustar laufersnobody Examples of using the for statement

    Examples of using the for statement

    To take each argument in turn and see if that person is logged onto the system.

       cat snooper
       #!/bin/sh
       # see if a number of people are logged in
       for i in $*
       do
         if who | grep -s $i > /dev/null
         then
           echo $i is logged in
         else
           echo $i not available
         fi
       done
    

    For each username given as an argument an if statement is used to test if that person is logged on and an appropriate message is then displayed.


    To go through each file in the current directory and compare it with the same filename in another directory:

       #!/bin/sh
       # compare files to same file in directory "old"
       for i in *
       do
         echo $i:
         cmp $i old/$i
         echo
       done
    

    If the list-of-words is omitted, then the loop is executed once for each positional argument (i.e. assumes $* in the for statement). In this case the loop will create the empty files whose names are given as arguments.

       #!/bin/sh
       # create all named files
       for i
       do
         > $i
       done
    

    Some examples of command substitution in for loops:

       #!/bin/sh
       # do something for all files in current
       # directory according to time modified
       for i in `ls -t`
       do
         ...
       done
       # do something for all non-fred files.
       for i in `cat filelist | grep -v fred`
       do
         ...
       done
       # do something to each sub-directory found
       for i in `for i in *
         do
           if test -d $i
           then
             echo $i
           fi
         done`
       do
         ...
       done
    

    [Home] [Search] [Index]
    scrpt/scrpt2.6.2.html100644 1032 165141 2277 6113364661 14132 0ustar laufersnobody The for statement

    The for statement

    The for loop notation has the general form:

       for var in list-of-words
       do
         commands
       done
    

    commands is a sequence of one or more commands separated by a newline or ; (semicolon).

    The reserved words do and done must be preceded by a newline or ; (semicolon). Small loops can be written on a single line. For example:

       for var in list; do commands; done
    

    [Home] [Search] [Index]
    scrpt/scrpt2.6.3.2.html100644 1032 165141 3652 6115617363 14273 0ustar laufersnobody Examples of using the while and until statements

    Examples of using the while and until statements

    To wait for someone to logout:

       #!/bin/sh
       while who |grep -s $1 >/dev/null
       do
         sleep 60
       done
       echo "$1 has logged out"
    

    This script checks to see if the username given as an argument to the script is logged on. While they are, the script waits for 60 seconds before checking again. When it is found that the user is no longer logged on a message that they have logged out is displayed.


    To declare when a file has been created:

       #!/bin/sh
       until test -f $FILE
       do
         sleep 60
       done
       echo "$FILE now exists"
    

    This tests every 60 seconds until the filename represented by the variable $FILE exists. A message is then displayed.


    To watch for someone to log in:

       #!/bin/sh
       # make sure we pick up the correct commands
       PATH=/bin:/usr/bin
       # remember $# is number of positional arguments
       case $# in
       1) ;;
       *) echo 'usage: watchfor username' ; exit 1
       esac
       until who | grep -s "$1" >/dev/null
       do
         sleep 60
       done
       echo "$1 has logged in"
    

    If more than one username is given to the command watchfor the message

       usage: watchfor username
    

    is displayed and the command fails.


    [Home] [Search] [Index]
    scrpt/scrpt2.6.3.html100644 1032 165141 3244 6113364661 14126 0ustar laufersnobody The while and until statements

    The while and until statements

    The while statement has the general form:

       while command-list1
       do
         command-list2
       done 
    

    The commands in command-list1 are executed; and if the exit status of the last command in that list is 0 (zero), the commands in command-list2 are executed.

    The sequence is repeated as long as the exit status of command-list1 is 0 (zero).

    The until statement has the general form:

       until command-list1
       do
         command-list2
       done
    

    This is identical in function to the while command except that the loop is executed as long as the exit status of command-list1 is non-zero.

    The exit status of a while/until command is the exit status of the last command executed in command-list2. If no such command list is executed, a while/until has an exit status of 0 (zero).


    [Home] [Search] [Index]
    scrpt/scrpt2.6.4.1.html100644 1032 165141 2323 6113364662 14264 0ustar laufersnobody Example of using the break and continue statements

    Example of using the break and continue statements

    To prompt for commands to run:

       #!/bin/sh
       while echo "Please enter command"
       read response
       do
         case "$response" in
         'done') break           # no more commands
                           ;;
         "")     continue        # null command
                           ;;
         *)      eval $response  # do the command
                           ;;
         esac
       done
    

    This prompts the user to enter a command. While they enter a command or null string the script continues to run. To stop the command the user enters done at the prompt.


    [Home] [Search] [Index]
    scrpt/scrpt2.6.4.html100644 1032 165141 3056 6113364662 14131 0ustar laufersnobody The break and continue statements

    The break and continue statements

    It is often necessary to handle exception conditions within loops. The statements break and continue are used for this.

    The break command terminates the execution of the innermost enclosing loop, causing execution to resume after the nearest done statement.

    To exit from n levels, use the command:

       break n
    

    This will cause execution to resume after the done n levels up.

    The continue command causes execution to resume at the while, until or for statement which begins the loop containing the continue command.

    You can also specify an argument n|FR to continue which will cause execution to continue at the n|FRth enclosing loop up.


    [Home] [Search] [Index]
    scrpt/scrpt2.6.html100644 1032 165141 1720 6113364663 13764 0ustar laufersnobody Flow of control statements

    Flow of control statements

    The Bourne shell provides several flow of control statements. Select an item for further information.


    [Home] [Search] [Index]
    scrpt/scrpt2.7.1.html100644 1032 165141 1413 6113364663 14123 0ustar laufersnobody Doing arithmetic

    Doing arithmetic

    The shell does not have any arithmetic features built in and so you have to use the expr command. Details are in the expr manual page.


    [Home] [Search] [Index]
    scrpt/scrpt2.7.2.html100644 1032 165141 2367 6115617673 14141 0ustar laufersnobody Including text in a shell script

    Including text in a shell script

    Text can be included in the shell script by using a here document, a special form of input redirection.

    The << symbol is used to indicate that text should be read up to a given mark. For example:

       #!/bin/sh
       # this script outputs the given text before it runs
       cat << EOF
       This shellscript is currently under development, please
       report any problems to Danny (danny@cornflake.ed)
       EOF
       exec /usr/local/test/bin/test_version
    

    The text is read from the script until a pattern is found which matches that after the << symbol; execution then proceeds as normal.


    [Home] [Search] [Index]
    scrpt/scrpt2.7.3.html100644 1032 165141 1517 6113364663 14132 0ustar laufersnobody Forcing evaluation of commands

    Forcing evaluation of commands

    Another built-in function is eval which takes the arguments on the command line and executes them as a command. For example:

       #!/bin/sh
       echo "enter a command:"
       read command
       eval $command
    

    [Home] [Search] [Index]
    scrpt/scrpt2.7.4.html100644 1032 165141 1761 6113364663 14134 0ustar laufersnobody Execute a command without creating a new process

    Execute a command without creating a new process

    The exec statement causes the command specified as its argument to be executed in place of the current shell without creating a new process. For example:

       exec zmail -visual
    

    This runs just the zmail program without a shell. When you quit the application the current shell also exits.


    [Home] [Search] [Index]
    scrpt/scrpt2.7.5.html100644 1032 165141 2610 6115617453 14127 0ustar laufersnobody Controlling when to exit a shell script

    Controlling when to exit a shell script

    The exit statement will exit the current shell script. It can be given a numeric argument which is the script's exit status. If omitted the exit status of the last run command is used. 0 (zero) signifies success, non-zero signifies failure. For example:

       #!/bin/sh
       if [ $# -ne 2 ]
       # "$#" is number of parameters- here we test
       # whether it is not equal to two
       then
       echo "Usage $0 \<file1\> \<file2\>"	# not two parameters
       # so print message
       exit 2             		# and fail ($0 is
       # name of command).
       fi
       ...<rest of script>
    

    This script is supposed to take two positional arguments. It will exit with status 2 (error) rather than 0 (success) if it is not called with two parameters.


    [Home] [Search] [Index]
    scrpt/scrpt2.7.html100644 1032 165141 2176 6113364664 13774 0ustar laufersnobody More shell functions

    More shell functions

    This section provides you with information about several functions which can be used within a Bourne shell script.


    [Home] [Search] [Index]
    scrpt/scrpt2.8.1.html100644 1032 165141 3376 6113364664 14137 0ustar laufersnobody Example of debugging a shell script

    Example of debugging a shell script

    To print commands and their arguments as they are executed:

       cat example
       #!/bin/sh
       TEST1=result1
       TEST2=result2
       if [ $TEST1 = "result2" ]
       then
         echo $TEST1
       fi
       if [ $TEST1 = "result1" ]
       then
         echo $TEST1
       fi
       if [ $test3 = "whosit" ]
       then
         echo fail here cos it's wrong
       fi
    

    This is a script called example which has an error in it; the variable $test3 is not set so the 3rd and last test [command will fail.

    Running the script produces:

       example
       result1
       [: argument expected
    

    The script fails and to see where the error occurred you would use the -x option like this:

       sh -x example
       TEST1=result1
       TEST2=result2
       + [ result1 = result2 ]
       + [ result1 = result1 ]
       + echo result1
       result1
       + [ = whosit ]
       example: [: argument expected
    

    The error occurs in the command [ = whosit ] which is wrong as the variable $test3 has not been set. You can now see where to fix it.


    [Home] [Search] [Index]
    scrpt/scrpt2.8.html100644 1032 165141 2160 6113364664 13766 0ustar laufersnobody Debugging shell scripts

    Debugging shell scripts

    To see where a script produces an error use the command:

       sh -x script argument
    

    The -x option to the sh command tells it to print commands and their arguments as they are executed.

    You can then see what stage of the script has been reached when an error occurs.


    [Home] [Search] [Index]
    scrpt/scrpt2.8.op.html100644 1032 165141 1740 6113364665 14407 0ustar laufersnobody Debugging options

    Debugging options

    You can use the following options either on the command line or with the built-in set command within a shell script to help you when debugging.

       -e in non-interactive mode, exit immediately
          if a command fails.
    
       -v print shell input lines as they are read.
    
       -n read commands but do not execute them.
    

    [Home] [Search] [Index]
    scrpt/scrpt2.9.1.html100644 1032 165141 2212 6113364665 14125 0ustar laufersnobody Signals to be caught

    Signals to be caught

    The following are the signals that are usually caught with the trap command.

       0  shell exit (for any reason, including end of file EOF).
       1  hangup.
       2  interrupt (^C).
       3  quit (^\\ ; causes program to produce a core dump).
       9  kill (cannot be caught or ignored).
       15 terminate; default signal generated by kill.
    

    [Home] [Search] [Index]
    scrpt/scrpt2.9.2.html100644 1032 165141 3244 6113364665 14134 0ustar laufersnobody trap: Handling command lists

    trap: Handling command lists

    The command list is placed between single quotes, as the command line is scanned twice, once when the shell first encounters the trap command and again when it is being executed.

       trap 'command-list' signal-list
    

    The single quotes inhibit immediate command and variable substitution but are stripped off after the first scan, so that the commands are processed when the command is actually executed.

    If command-list is not specified, then the action taken on receipt of any signal in the signal-list is reset to the default system action.

    If command-list is an explicitly quoted null command (' ' or " "), then the signals in signal-list are ignored by the shell.

    The command-list is treated like a subroutine call. The commands in the list are executed when the signal is trapped and control is then returned to the place at which it was interrupted.


    [Home] [Search] [Index]
    scrpt/scrpt2.9.3.html100644 1032 165141 4710 6115617512 14126 0ustar laufersnobody Examples of interrupt handling

    Examples of interrupt handling

    To use single quotes to inhibit command substitution:

       #!/bin/sh
       trap 'echo `pwd` >>$HOME/errdir' 2 3 15
       for i in /bin /usr/bin /usr/any/bin
       do
       cd $i
       some series of commands in the directory $i
       done
    

    The file errdir will contain the name of the directory being worked on when the procedure is interrupted. What happens if the same procedure has double quotes around it?

       trap "echo `pwd` >errdir" 2 3 15 
    

    The file errdir will just contain the name of the directory from which the procedure was invoked because the pwd command would be substituted on the first scan by the shell and not when it is invoked in the script.


    To remove temporary files when a procedure is interrupted:

       #!/bin/sh
       temp=/tmp/file.$$
       trap 'rm $temp; exit' 0 1 2 3 15
       ls > $temp
       .....  
    

    If any of the named signals are encountered, the command rm $temp; exit will be executed. The exit command is needed to terminate the execution of the whole procedure.


    To continue processing commands after a trap command:

       #!/bin/sh
       # read and process commands
       dir=`pwd`
       for i in *
       do
         if test -d $dir/$i
         then
           cd $dir/$i
           while echo ''$i:''
           trap exit 2   # trap ^C
           read x
           do
             trap ' ' 2      # ignore interrupts
             eval $x
           done
         fi
       done
    

    The shell continues to process commands after a trap command. The entire procedure is terminated if interrupted when waiting for input, but the interrupt is ignored while executing a command. The command list is an explicitly quoted null command and so the signal is ignored by the shell.


    [Home] [Search] [Index]
    scrpt/scrpt2.9.html100644 1032 165141 2512 6113364666 13772 0ustar laufersnobody Trapping operating system signals

    Trapping operating system signals

    Shell procedures may use the trap command to catch or ignore Unix operating system signals. The form of the trap command is:

       trap 'command-list' signal-list
    

    Several traps may be in effect at the same time. If multiple signals are received simultaneously, they are serviced in ascending order.

    To check what traps are currently set use the trap command. For example:

       trap
    

    [Home]