home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula
/
nebula.bin
/
Newsletters
/
GEnieUnixNews
/
unxnl-05.92
< prev
next >
Wrap
Text File
|
1993-01-27
|
43KB
|
948 lines
_ _ _ _ _ _
// // //| // // \// N E W S
//_// // |// // /\\ Vol 3, Issue 5 - May 1992
R o u n d T a b l e (tm)
Items of interest to participants of the GEnie Unix RoundTable
The RoundTable SysOps are:
Andy Finkenstadt....ANDY Rick Mobley.........LRARK
Gary Smith..........GARS Brian Riley.........DELPHI
Mike Nolan..........M.NOLAN All Unix SysOps.....UNIXSYSOPS$
We strongly encourage you to contact any or all of us if you have -ANY-
comments or suggestions. This is -YOUR- RoundTable. We are here to make
your participation as pleasant and beneficial as possible.
ED: editor notes - Previews of coming attractions (GARS) Gary Smith
==
Some of you have noticed the software libraries suddenly expanded from
twenty-eight named libraries to thirty-one with an additional eight reserved
libraries. Some even noticed the reference to SLA file sections.
SLA, Stereolithographic Association, has elected to make the GEnie Unix
RoundTable their home. This is a group that uses some very sophisticated
equipment, frontended by a SGI Unix platform, to output solid engineering
models in a very short time frame, thus reducing dramatically the time lapse
from engineering design to prototype. It is exciting to see Unix blazing
new paths in such a manner, and we look forward to their presence in our
online family.
There are other groups that will be joining us very shortly that will add
spice to the online discussions and grant each of us an opportunity to gain
insight through the activities of others. We have already seen the NeXT
users demonstrate how a dedicated group, given an outlet like the GEnie Unix
RoundTable can create a solid support and resource center that draws others
to them. It excites me, as a SysOp and observer, to see limits removed and
opportunities rise in their place.
Stick around folks. The show has only begun.
NUCON 22 in Atlanta, a report (M.NOLAN) Mike Nolan
=============================
The 22nd annual NCR User's Conference was also the first since
NCR's acquisition by AT&T. Although there were a few signs of
AT&T's presence, for the most part it was business as usual. A
reference to NCR as the 'Network Computer Resource of AT&T', which
surfaced a few months ago, has apparently been dropped.
There were a few NCR badges with New Jersey addresses, and some of
them were ex-AT&T people, but an equal number were new hires. On
the show floor, the most visible signs were the StarServer network
products, buried along the back wall of the NCR booth, and the
Safari notebook systems, now renumbered into the NCR 3100 series
but some still in cases with the Safari logo on it, along with an
NCR logo.
The latest of these, the 3170, features a FingerPointMouse, sort of
a built-in stickless joystick operated with the index or middle
finger. Although it is primarily an MS-DOS machine, the 3170 is
interesting because it comes with a flashcard port instead of a
floppy drive, which makes it incredibly thin and light, even with
a battery and an 80MB hard drive it was still under five pounds.
An external floppy drive is available, as is an 'Expansion Manager'
a docking station with a floppy drive, a CD ROM drive, and two
expansion slots. Total weight is still only 13 pounds.
NCR gave away a bag with a joint NCR/AT&T 'Putting it all together'
theme, and most of the NCR employees had a pat 'this has been a
good move' speech, but at the hospitality suite it was pretty easy
to spot the former AT&T employees, they were the ones trying to
figure out how much they should enjoy the party. NCR's reputation
as a company that works hard and plays hard seems intact. (Whew!)
NUCON does not usually get many significant product announcements,
and 1992 was no exception there. However, a working model of the
NCR 3600 massivly parallel system was on the floor, as were the
recently released 3450 and 3550 systems. The 3550 features some
innovative fault-tolerant features, including redundant power
supplies and modularized peripherals. (Most peripherals can be
shut down and serviced without bringing down the entire system.)
The 3550, which holds 2-8 processors, uses SVR4-MP, NCR's multi-
processor version of AT&T System V Release 4.
NCR also showed production versions of their RAID (Redundant Array
of Inexpensive Disks) systems, in which 9 drives appear as one.
With one drive as a parity drive it is possible to lose one drive
without losing any data, and it can also be serviced while the
remaining drives stay online. A utility program initializes and
restores the data to the replaced disk. Sustained data transfer
rates in excess of 20 megabytes per second are also possible on the
SCSI-2 bus.
Computer columnist and commentator John Dvorak was one of the
keynote speakers. John seems to have done another turnabout and
feels the PC industry is on the verge of the next major platform
change. John downplayed the possible impact of Windows NT, saying
that people won't trust Microsoft another time, and said that he
feels Unix is 'cursed'. The new platform, John feels, will be
based on OS/2. However, both of the last two platform changes (the
Apple ][ and the IBM PC) were essentially driven by 'killer'
applications (Visicalc and Lotus 1-2-3), and John was at a loss to
predict the next killer app. Notably absent from John's commentary
was any mention of Apple Computer. His disparaging remarks about
Unix were ironic at a group which is becoming increasingly Unix
oriented, as NCR is using Unix as its primary operating system on
its new products.
----------
Lead Sysop Notes (ANDY) Andrew Finkenstadt
================ Chief Sysop
Another month has gone by, and the Unix RoundTable is expanding still
more. The Stereolithograpy Users Group is joining us with a bulletin
board category for public discussion. Stereolithography is a 3D
Modeling and Rapid Prototyping technique using Silicon Graphics
machines, running a version of UNIX, of course. Even the most non-technical
of us will find the messages here fascinating and informative.
The month of April saw the status update on the GEnie Internet
gateway. No further updates are available at this time, though
I am anxiously awaiting the release of it. Stay tuned.
The Unix Help Desk in the Conference Area and Chat Lines has helped
a number of people with big and small problems. Recently a man
located in Tennessee set up his company's network and lamented
the long addresses required for each person from one end of his
network to another. A quick pointer to 'smail' and its capabilities
and he was all set to go. A tutorial on domain names and Internet
Protocol Number assignments followed. He's now a satisfied man.
Look for a notice from me about a Survey for the Unix RT participants.
I want to offer you what you want and need, and this is one tool
by which I can do this. Feel free to drop me an E-Mail (my address
is ANDY, or andy@vistachrome.com, or uunet!rde!andy) and I'll
read and respond to your feedback with great interest.
Until next month, happy computing!
-Andy
Upload Contest Winners for April (ANDY)
================================
Congratulations go to Ken Ficara and Toshi Morita for their
qualifying uploads in the Unix RoundTable Upload Contest. Each
of them has won a free day of their choosing in the Unix RT.
Ken uploaded the excellent guide to Internet folklore called {ZEN
and the art of the Internet}, #3321 and Toshi uploaded some of
the Linux free version of Unix for the 386 files, including the
VERY popular Readme file, #3205. {ZEN} will be released on
Monday, May 11, so don't fret if you can't find it right away.
You too can qualify to win in the upload contest. Download file
#2346 CONTEST.RULES and start uploading.
usr/local: Items (scripts and news) snarfed from various sources
=========
News for Unix Users and wanna-be's. (DELPHI) Brian Riley
-----------------------------------
For those of you who can't keep up with the latest
happenings in the Unix world, here are the highlights.
New Telebit Modem:
The WorldBlazer external modem has a maximum sustained throughput
of 23000 bps using Turbo-PEP, a new propriatary protocol, over
clean lines. The modem also supports V.32bis, V.42, V.42bis,
UUCP, Kermit, XMODEM and YMODEM. Owners of T3000's will be
able to upgrade to the WorldPort with a new chip set and
faceplate. Fax capabilities are scheduled for release in
September.
Unix Tools for Dos & OS/2:
Mortice Kern Systems has released version 3.1 of their popular
LEXX and YACC utilities. These tools are useful for creating
compilers, database languages or extension languages for Dos
and OS/2 systems and are compatible with Unix tools of the same
name. YACC 3.1 now includes YACC Tracker, a debugging tool for
developers and there is online help for both tools. Also
from MKS is version 5.2 of RCS, a source code control system wich
now includes support for binary as well as text files and
enhanced security features. MKS Toolkit is up to version 3.2 and
emulates SVR4 utilities, adds enhancements to some commands and
includes MKS Korn shell.
Shrink wrapped UNIX:
Unix System Laboratories announced the scheduled release of
Desktop Unix, otherwise known as Unix Lite, for MIPS, SPARC and
Intel platforms for the third quarter with source code versions
available this summer. Five OEM's will be porting DeskTop Unix to
the various platforms. This will reduce the number of Unix
"flavors" so small vendors will be able to bundle Unix Lite with
machines and still maintain a low profit margin.
A new SUN rises:
SPARCstation 3 is the latest offering from SUN MicroSystems in
the battle for the top workstation of the future. The new
SPARKstation is said to have a rated performance of 50 SPECmarks,
a 40 Mhz processor and include an ISDN port on the motherboard.
It will accomodate up to 4 processors with the base system price
roughly equal to the SPARCstation 2. The price of the
SPARCstation 2 is expected to come down around May 19 when the
SPARCstation 3 will begin shipping.
Brian T. Riley
Tidbits (LRARK) Ricky Mobley
-------
Article 187 of comp.bugs.misc:
Path: lrark!ddi1!uunet!uunet!think.com!mips!mips!
munnari.oz.au!deakin.OZ.AU!rand!cocamrd.mel.cocam.oz.au!rdb
From: rdb@cocamrd.mel.cocam.oz.au (Rodney Brown)
Newsgroups: comp.lang.misc,comp.bugs.misc,comp.unix.questions
Subject: Limits to awk
Summary: For NF > 99 or length($0) > 3071 use mawk, gawk or perl
Message-ID: <1076@rand.mel.cocam.oz.au>
Date: 25 Mar 92 22:23:22 GMT
Sender: usenet@rand.mel.cocam.oz.au
Followup-To: comp.bugs.misc
Organization: Co-Cam Computer Group, Oz
Lines: 167
Xref: lrark comp.lang.misc:473 comp.bugs.misc:187 comp.unix.questions:17886
Some years ago I was tripped up by the undocumented (as far as I could see)
limits in line lengths & numbers of fields in awk.
This summarizes the limits in the awk versions I tested with the script in the
enclosed shar.
Maximum Maximum
Length Fields Machine & awk Size Date Uname
3072 100 /bin/awk 102364 880511 XENIX 2.3.3 SysV i80386
3072 100 /usr/bin/awk 89108 900612 SCO 3.2 2 i386
2561 99 /usr/bin/awk 155648 900118 HP-UX hp835 A.B7.00 D 9000/835
3072 99 /usr/bin/nawk 192512 900118 HP-UX hp835 A.B7.00 D 9000/835
2560 99 /bin/awk 86608 891031 AIX Self 2.1 2 20B0166C-IBM RT
3072 99 /bin/awk 194257 900521 AIX rs6000 1 3 000006073100
3072 99 /bin/awk 194769 901110 AIX rs6000 1 3 000060783100
2560 99 /usr/bin/awk 56072 910107 SysVR4v2.0 4.0 2.0 i386/i486
3072 199 /usr/bin/nawk 110356 910107 SysVR4v2.0 4.0 2.0 i386/i486
2560 99 /bin/awk 110592 910319 ULTRIX 4.2 0 RISC
19998 4000 /usr/bin/nawk 102400 910319 ULTRIX 4.2 0 RISC
3071 100 /usr/bin/nawk 163840 901012 SunOS 4.1.1 1 sun4c
2559 99 /usr/bin/awk 90112 901012 SunOS 4.1.1 1 sun4c
>=4095 >=4096 Gnu Awk (gawk) 2.13, pl 2 SunOS 4.1.1 1 sun4c
>2**17 32767 c.s.r/mawk/mawk1.1/mawk XENIX 2.3.3 SysV i80386
32767 32768 Gnu Awk (gawk) 2.13, pl 0 XENIX 2.3.3 SysV i80386
>2**17 65000 perl 4.0.1.6 pl 19 XENIX 2.3.3 SysV i80386
/bin/awk core dumps for lengths > 14778 XENIX 2.3.3 SysV i80386
/usr/bin/awk core dumps for lengths > 11419 SCO 3.2 2 i386
/bin/awk core dumps for lengths > 2564 AIX Self 2.1 2 20B0166C-IBM RT
/bin/awk core dumps for lengths > 3120 AIX rs6000 1 3 000006073100
/bin/awk core dumps for lengths > 3120 AIX rs6000 1 3 000060783100
/usr/bin/nawk core dumps for lengths > 5384 HP-UX hp835 A.B7.00 D 9000/835
/usr/bin/awk core dumps for lengths > 2582 SysVR4v2.0 4.0 2.0 i386/i486
/usr/bin/nawk core dumps for lengths > 3098 SysVR4v2.0 4.0 2.0 i386/i486
/bin/awk core dumps for lengths > 9946 ULTRIX 4.2 0 RISC
ULTRIX 4.2 0 RISC
/usr/bin/nawk doesn't give an error at its maximum line length of 19999
(including the newline) instead it splits the input line into segments of
that length.
Both mawk 1.1 & gawk 2.13 seem to cope with very large records,
gawk 2.13 however seems to be returning the length as a short which is
why 32767 is the value shown in the table.
This is the error gawk gives when presented with 32769 fields :-
gawk: fatal error: set_field: nodes: can't allocate memory (Not enough core)
and for mawk with 32768 fields :-
mawk: program limit exceeded: maximum number of fields size=32767
The values for perl are from using a2p on the awk oneliners used.
The 65000 is the split maximum introduced by a2p.
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: awkfld.sh
# Wrapped by rdb@cocamrd on Wed Mar 25 23:20:07 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'awkfld.sh' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'awkfld.sh'\"
else
echo shar: Extracting \"'awkfld.sh'\" \(2152 characters\)
sed "s/^X//" >'awkfld.sh' <<'END_OF_FILE'
X:
X# Script tries to find maximum record length for awk & maximum number
X# of fields awk can cope with in a record.
X# Also checks for core dumps on long records.
X# It is using m4's eval(0,10,length) to generate output of given lengths
X# - which probably requires some kind of SysV m4 - or GNU m4 1.0
X# Use length($0) instead of length for mawk 1.1
X#
X# A maximum record length of 4096 is used
X# Larger record lengths will require increasing the size of m4's push back
X# buffer -- m4 -B140000 will cope with 2**17
X# The upper value to search for can be specified as an argument to the
X# script.
X# Note that large numbers of fields (32767) takes a long time (in mawk & gawk)
.
X#
Xl=0;
Xuname=`uname`
Xif [ $uname = 'ULTRIX' ] ; then
X M4=${M4-m4}
X AWK=${AWK-awk}
X awk_name=`which $AWK`
X u=${1-4096};
Xelse
X if [ $uname = 'SunOS' ] ; then
X M4=${M4:=/usr/5bin/m4}
X else
X M4=${M4:=m4}
X fi;
X AWK=${AWK:=awk}
X awk_name=`type $AWK | sed 's/^.*[ ]\([^ ]*\)$/\1/'`
X u=${1:-4096};
Xfi
Xuname -a
Xls -l $awk_name
Xif [ `expr ${AWK} : 'gawk$'` != 0 ] ; then
X ${AWK} -V
Xfi
Xif [ -f core ] ; then
X rm -f core
Xfi
Xecho "eval(0,10,$u)" | $M4 \
X| $AWK '{print length($0)}' >> /dev/null 2>&1 ;
Xif [ -f core ] ;
Xthen
X while [ `expr $l + 1` -ne $u ] ; do
X m=`expr $l + $u`;
X m=`expr $m / 2`;
X if echo "eval(0,10,$m)" | $M4 \
X | $AWK '{print length($0)}' >>/dev/null 2>&1\
X || [ ! -f core ] ;
X then
X l=$m;
X else
X u=$m;
X rm -f core
X fi
X done
X echo $awk_name core dumps for record lengths greater than `expr $u - 1`
Xfi
Xl=0;
X while [ `expr $l + 1` -ne $u ] ; do
X m=`expr $l + $u`;
X m=`expr $m / 2`;
X x=`echo "eval(0,10,$m)" | $M4 | $AWK '{print length($0)}' 2>>/dev/null`;
X if [ $? != 0 -o "$x" != $m ] ;
X then
X u=$m;
X else
X l=$m;
X fi
Xdone
Xecho Longest record for $awk_name is `expr $u - 1`
Xl=0;
X# AWK=/user/AUUG/gnu/gawk-2.11/gawk
Xwhile [ `expr $l + 1` -ne $u ] ; do
X m=`expr $l + $u`;
X m=`expr $m / 2`;
X if echo "eval(0,10,$m)" | $M4 \
X | $AWK -F0 '{print NF}' >> /dev/null 2>&1 ;
X then
X l=$m;
X else
X u=$m;
X fi
Xdone
Xecho Maximum fields for $awk_name is $u
END_OF_FILE
if test 2152 -ne `wc -c <'awkfld.sh'`; then
echo shar: \"'awkfld.sh'\" unpacked with wrong size!
fi
chmod +x 'awkfld.sh'
# end of 'awkfld.sh'
fi
echo shar: End of shell archive.
exit 0
--
Rodney Brown, Co-Cam Computer Group, ACSNet: rdb@mel.cocam.oz.au
--
rick@lrark.UUCP * bang path --> uunet!ddi1!lrark!rick *
Ricky Mobley * lrark (501) 224-9454 *
1800 Sanford Dr. #4 * GEnie Unix RT SysOp address LRARK *
Little Rock, AR 72207 * WB5FDP.AR.USA.NA wb5fdp.ampr.org *
----------
"POPULAR" Files Listing Andrew Finkenstadt
======================= GE Mail Address ANDY
Over the past couple of months, many of you have visited the
software libraries and downloaded some interesting files. In
case you were wondering what you missed, here are 38 of our
most popular files which will also be of interest.
I would like to personally point out the files from the "Frequently
Asked Questions" (FAQ) list for Unix systems in general. The questions
answered here are ones that everyone will want to know. This
is the April 1992 issue of the FAQ from the Usenet.
File File Name Size Lib
# Short Description
----- -------------------------------- ---------- ----
3222 UNIX.FAQ1.492 13,568 5
3223 UNIX.FAQ2.492 29,568 5
3224 UNIX.FAQ3.492 28,288 5
3225 UNIX.FAQ4.492 23,296 5
And without further ado, here is the listing:
2466 ANON-FTPLIST.Z 45,056 16
File File Name Size Lib
# Short Description
----- -------------------------------- ---------- ----
Anonymous FTP Site listing
3051 BSD-README 16,768 1
386BSD release 0.0 description
3132 CAWF2.ZIP 134,528 3
CAWF, an nroff clone for MS-DOS
2727 COMPRESS.ZIP 13,696 13
msdos/unix compress util
3167 CRACK41.TAR.Z 112,640 1
crack41.tar.Z, password cracker
921 DOMAIN.INF 7,560 15
Intro to paths and domain names
1525 DOSTAR.COM 22,680 13
This is a MS/DOS tar program
2376 E-MAIL.GUIDE 18,688 4
John Chew's Internetwork guide
2914 FPTED2.TAR.Z 34,688 11
FPTED2.tar.Z, User friendly editor
68 INTERNET.ARC 32,760 1
Hitchiker's Guide to Internet
2888 LINUX-ELVIS.TAR.Z 78,080 3
elvis (vi) for linux, binary
2758 LINUX-FAQ.TXT 32,768 5
Frequently Asked Questions-LINUX
2780 LINUX-FILES 15,488 10
Linux files available via FTP
2890 LINUX-GREP.TAR.Z 72,832 8
grep 1.5 binary for linux
2750 LINUX-INFO 27,904 10
Information on the LINUX unix clone
2891 LINUX-PMAKE.Z 72,320 10
Make for LINUX (binary)
3002 LINUX-RELNOTES-0.95 10,752 10
Release Notes, Linux Version 0.95
3121 LINUX-ROOTIMAGE-0.95A.Z 638,464 3
Linux 0.95a root filesystem image
2047 MK42BASE.TAR.Z 1,326,976 10
mk42base.tar.Z, Mach internals
3141 NETVIEWS-UNIX AND NT 78,208 27
Will Windows NT kill Unix?
3206 NIXLONG.04.92 52,480 15
NixPub long listing for April 1992
3106 NIXPUB.SHORT.LONG.0292 62,464 15
long and short public sites Feb 1992
2016 PCOMM12.TAR.Z 176,384 16
pcomm12.tar.Z, pcomm v 1.2.5
2728 PC_TAR.ZIP 25,984 13
tar utility for the pc
2892 PM_SUPP-TAR.Z 6,400 10
Supplemental files, Linux Pmake
722 PROTOCOL.TXT 46,620 17
Compression and Upload Protocol Docs
3205 README.95C 2,560 10
README file for boot95c (Linux 0.95c
2551 README.MAP 18,688 15
how to interpret the UUCPmap files
3066 RTC0310.92 17,664 2
Transcript of 03/10/92 RTC.
2485 RZSZ.SH.1208 176,512 16
ZMODEM C Source Code
3012 TREE.C 4,352 1
tree.c, directory tree browser
3040 UNIDOS11.ZIP 9,216 1
UNIX <--> DOS text file converter
3118 UNIV_ZIP.TAR.Z 194,816 13
univ_zip.tar.Z, universal zip/unzip
3222 UNIX.FAQ1.492 13,568 5
Frequent Unix Questions 4/92, part 1
3223 UNIX.FAQ2.492 29,568 5
Unix Frequent Questions 4/92, Part 2
3224 UNIX.FAQ3.492 28,288 5
Unix Frequent Questions 4/92, part 3
3225 UNIX.FAQ4.492 23,296 5
Unix Frequent Questions 4/92, part 4
69 UNIX.QUESTIONS.1089 47,880 5
Unix questions with answers 10/89.
1918 UNIX_NEW.TXT 30,592 5
unix_new.txt, answers to questions
2938 UNXNL-02.92 23,552 27
Unix RoundTable newsletter Feb 1992
3044 UNZIP 4.1 TAR.Z 112,256 13
UNIX utility to extract MS-DOS ZIPs
3179 VI.CKV.Z 3,840 3
vi.ckv.Z, C coding/log macros for vi
3020 VI.MACROS.Z 16,128 3
vi.macros.Z, tutorial - vi macro use
3187 XGIFTOOL.TAR.Z 21,760 18
Xgiftool.tar.Z, describe/view gif's
2504 XYZMODEM.ZOO 46,336 16
xyzmodem.zoo, comm C source
----------
FAST and NASTY, DOWN and DIRTY: quick fix scripts that do something
================================
Sub: The Colorado memory systems tape
We have a Colorado Memory Systems tape backup at work. Yes, I knew
you'd be thrilled to learn that.
Well, it seems that thae the good people at CMS did not write jtape
so that it would send out a return code when no tape's in the drive.
I have resorted to a bit of a work around to deal with this
situation. I thought I'd pass it along to you, and maybe it will
turn out to be useful to someone. My script writing skills aren't
too wonderful yet, but I believe you'll get the idea.
SCRIPT:
# This guy is set up for the Bourne shell.
#Backup script to be run on a regular basis by cron
if jtape retension | grep 'Error 85' # Error 85 = no tape
then
echo "NO BACKUP FOR YOU -- NO TAPE" >/dev/console
exit 1
else
jtape backup "/" -na -c -j -np -s -t "`date` backup" >somefile \
2>somefile
fi
----------
Tutorials
=========
vi - part 3, advanced features (GARS) Gary Smith
== ------ -----------------
A tutorial on the Unix visual text editor from the GEnie Unix RoundTable
-- abstract --
Part 1 provided an introduction to vi and gave a quick start to vi usage.
Part 2 finished the basic tools instruction for adding, inserting,
changing and deleting text.
Part 3 (this session) will be an introduction to macros and a summary
of what we have learned. There will also be some explanation
of vi's many hidden secrets.
-- macro basics --
As we discovered in part 2, text can be yanked and put (cut and pasted)
with vi(), and we even cleaned up our test file using these techniques.
If you found yourself thinking that while that worked, more modern editors
do the same job with more ease. You would be right, but you would also be
making your judgement based on incomplete information. Vi has more tricks
hidden in it than a carnival magician's coat. There is always another way
to do things in vi, and many of them are single keystroke works of art.
Others require some thought in advance, then perform incredible global
edits. Macro commands can be very tricky, involving nested routines. If you
really want to use one of the finest edit tools ever created you will take
the time to explore each of these commands deeper than this tutorial can
or should take you.
-- buffers and macros --
"xyy Yanks the current line into a named buffer x, then "xP puts the
text stored in buffer x before the cursor. x can be any of the twenty-six
letters of the English alphabet. I usually just name mine a, b, c ...
notice the reference to a 'buffer' area and remember an earlier reference
to vi's use of buffers. Those buffers are a major key to vi's power.
Another use of buffers many users aren't even aware of is what I call
the 'oops' syndrome. Have you ever accidently deleted a word or line
of text only to discover " 'oops', wrong one!"? Of course, you have. We
all have. Vi buffers to the rescue. Vi maintains the last nine (9) deletes
in buffers. If you know which delete (say 2 have occured since then, your
'oops' is number 3) it was all you have to do is position your cursor and
type "np where n is the number of the delete.
So, you have nine delete buffers, twenty-six named buffers and your entire
edit file. That's right, vi is editing your file in a temporary buffer. Not
only that, but if you lose power your file will be preserved in a .preserve
directory. When the system powers back up, /tmp contains ex files. A utility
called /usr/lib/ex3.7preserve is run from etc/rc which sees /tmp and converts
it to a preserve file. As soon as you log back in, you will get a mail memo
telling you there is a preserved editor file (vi or ex) you can recover. If
you type ex -r or vi -r at the system prompt, you will be presented a list
of recovered files. The last edit you did will probably not be saved, but
the file as it existed before your last edit will be entirely intact.
If you had suffered a system crash while editing our test file, you would
simply enter:
vi -r test
Yes, you can use this preserve buffer even without a system crash by using
the ex command :pre.
Now, let's say you are editing a group of files into one cohesive report,
but you can't remember all their names. An example might be a series of
dated travel reports you have to assemble as one trip report, and the days
are not sequential. You could write down or screen print the file list before
you start your edit and refer to your list. You could also let another macro,
map do the work for you. Map lets you create an escape macro that will do
a job for you. In our case, it is going to create a single keystroke command
to list the files in our directory and return us to vi and our edit file.
The syntax is simple, and uses the ex map command.
:map l :!ls <enter>
Now, each time you want to list the files in the directory, make sure you
are in the command mode and hit l. You will get a directory list immediately
with a massage to hit enter to return to vi. You hit enter, and type
:r filename <enter> to reaad in the next file who's name you just verified.
If your terminal has function keys you can make this even more fun. If you
want function key 3 to list your directory the syntax would be:
:map #3 :!ls <enter>
What if you discovered you had screwed up by mapping a key you want to use
in its normal capacity - like assigning l, when we are using it for cursor
control. If you realize it immediately use your u (undo) command. If you
discover it later in your edit type:
:unmap l <enter>
You can chain mapped macros in one map statement. It is not necessary to
create one macro function per map statement. Macros are simply pre-defined
sequences of keystrokes. There is nothing to prevent you from calling other
predefined keystrokes. CAUTION!!! DO NOT create a recursive macro. vi will
forbid you from creating a macro that calls itself at the end of its sequence,
but it will not prevent you from embedding such a call. DO NOT do it. The
results are disastrous. A recursive macro will expand very rapidly, and
can loop indefinitely, wipe out your text or suck memory like a black hole.
Should you accidently create such a monster remember that most macros can be
interrupted. Try hitting DELETE, RESET/BREAK and <CNTL> C.
Two very important macros have been reserved for the next session. These
are autoindentation and abbreviations. We will also examine some limitations
of macros.
-- vi/ex archive --
The GEnie Unix RoundTable has been authorized to mirror the vi/ex archive
maintained in Bergen Norway by Ove Ruben R. Olsen. The authorization letter is
conatined in file #2774. There are MANY tutorials, fine help and usage files,
and refernce charts for vi() and ex() in our library as a result. You can find
these files by using vi. (with a dot) and ex. as your search keywords. I want
to encourage you to capture these files and learn from the masters how to turn
vi and ex into the power user's tools they can and should be.
One of those files is vi.ref.Z, and I am going to copy it here to summarize
the ex/vi commands you should be comfortable with by now. If you see a command
and don't know how it works, load your test file and find out by using it. I
repeat from sessions 1, "Using computers, and especially a complicated editor
like vi() is a participation, not a spectator, activity."
Unix vi Reference Card
arrow keys move cursor ^n,^p,<SP>,<BS> same as arrows
<ESC> escape from text entry ^g tell what is going on
: give ex command ZZ write and quit
<CR> start of next line - start of previous line
^b go back one page ^u scroll back 1/2 page
^f go forward one page ^d scroll forward 1/2 page
or end indent
^e scroll down one line ^y scroll up one line
H home screen line L last screen line
x delete character r replace char with next
typed
a append after cursor A append after line
i insert before cursor I insert before line
p put before cursor P put before line
u undo changes U undo changes in this
line only
c obj change object to following text
Object defining characters
w forward one word W forward, ignore punctuation
b backward one word B backward, ignore punc.
e end of current word <CR>,- as above
Characters using buffers
d obj delete object dd delete line
y obj yanks object yy yank line
p place what is in buffer
" select buffer
NOTE: There are 26 buffers, each corresponding to a letter of the
alphabet. To refer to a specific buffer type "<letter> e.g. "a
refers to buffer a. Therefore "add would delete the line that
cursor is on and place it into buffer a. To place the deleted
line elsewhere, position cursor and type "ap.
In order to delete or yank a section of text, you must place a
mark to where the deletion/yank is to stop. This is done by
typing: m<letter> (do not use the same buffer to place a mark
and store text). To return to that location, type `<letter>.
When deleting or yanking to a mark, say b, position the
cursor at the beginning of the desired text, and type "ad`b.
This deletes the text from cursor until mark b, and places it
in buffer a. "ad'b will delete until the end of the line in
which mark b is (note difference in ` and ').
Search
/text<CR> search forward for text ?text<CR> search backward
n next occurance N next occurance in
opposite direction
Miscellaneous
J adjoin current line to line above
!! place results of command into file
i.e. !!cat it.p will place the list of it.p in your file.
Unix ex Reference Card
n set pointer to line n
n,n specify a range of lines for next command
$ used to indicate last line in file
. print current line or end insertion
p print specified lines
p# print specified lines with line numbers
a append lines after this line; end insertion with "."
i insert lines after this line; end insertion with "."
d delete specified lines
u undo last deletion or substitution
c change (i.e. replace) specified lines to new text
ya yank specified lines into buffer
pu lines from buffer before this one
w write current text to file
q quit edit
q! forces quit without write
wq write and quit
vi enter vi editor
se display settings; refer to manual for details
/text/ search for text
// search for next occurrence
s/oldtext/newtext/ substitute newtext for oldtext in
specified lines
n1,n2copy3 copy lines n1-n2 to after n3
global/pattern/cmds search file for pattern and do cmds on those
lines.
set nu insert line numbers
set nonu remove line numbers
--
"...nothing kills that does not know ye."
-Meg Davis, `The Elf Glade'
UUCP: ihnp4!gargoyle!sphinx!d757 d757@sphinx.uchicago.edu
Lawrence Lerner University of Chicago Computation Center
__ _ Gary Smith * ... uunet!ddi1!lrark!glsrk!gars *
/ _' _ _ (_' P. O. Drawer 7680 * nuucp%ddi1@uunet.UU.NET *
/__/ (_|_/ '._) Little Rock,AR 72217 * GEnie Forth RT & Unix RT SysOp *
--------------- - U. S. A. - * ph:501-227-7817,fax:501-228-9374 *
(M-F 0800-1700 CST)
**** End of article
----------
M4 (1) Tutorial, Part 2 Andrew Finkenstadt
======================== GE Mail address ANDY
In February 1992 we began part 1 of this tutorial (file #2938) by
discussing the uses of m4(1) as a filter for programming and
documentation, and then used it as part of a database design project
using SQL, Structured Query Language.
This month we discuss the various command line options that are given
to m4 when running it, and why we would want to use these options.
Under Interactive Unix System 5 Release 3.2 the m4 processor has just
8 command line options to consider. These are:
-e "Operate interactively. Interrupts are ignored and the output
is unbuffered."
That is to say, when you specify -e on the command line, you
run m4 as if you are typing directly to it. The reason why
interrupts are ignored is to compensate for a noisy phone line.
-e is the easiest way to test out some m4 commands before you
commit them to disk.
-s "Enable line sync output for the C preprocessor."
The C preprocessor (typically systems now call this /lib/cpp or
cc -E) uses this to enable it to track where it is within the
original source code program.c - it causes m4 to emit
placemarkers after processing each line. (C compilers
typically tell you that 'such and such error' occured on line
44. It knows this via the #line comments from m4.)
#line 1
the results of line 1
#line 2
the results of line 2
-B### "Change the size of the push-back and argument collection
buffers from the default of 4,096."
m4 only allocates a mediocre amount of memory to macro
expansion and substitutable parameters, namely 4K. In general
this is sufficient for just about any project, but if you end
up going macro happy or have a very large expansion, you may
run out of push-back space and receive a cryptic error message
- or (gasp!) output that is just plain wrong.
If you encounter problems with macros seemingly not working
right, and can't find any other causes, try increasing the
push-back size by 4K or more. (IE: try -B8192 or -B16384 and
see if the problem goes away.)
-H### "Change the size of the symbol table hash array from the
default of 199. The size should be prime."
m4 uses a hash table to increase the speed with which
definitions and macros are found. A typical hash function
will cause the definition to be found on the first or second
try. If many definitions are used then better performance may
result by increasing the number of elements in the symbol
table array. The number had better be prime, else Bad Things
Happen.
-S### "Change the size of the call stack from the default of 100
slots. Macros take three slots, and non-macro arguments take
one."
m4 uses a fixed-size stack to contain macro expansions and
arguments as they are evaluated. (A stack can be likened to
the stack of plates at a restaurant: you put a plate on the
top of the stack, and then when you need a plate, you take the
top plate from the stack.)
As larger macros are used, with greater complexity, it is
likely that the stack array will need to be increased. It is
good to try increasing this value slowly, perhaps to 150 and
then to 200.
-T### "Change the size of the token buffer from the default of 512
bytes."
A token is the largest "thing" that m4 will recognize. If you
were to set T to -T32, then any "token" (you can think of a
token as a word between spaces or punctuation) longer than 32
characters would be either ignored, rejected, or shortened.
If 512 bytes is not enough, perhaps you should teach others
how you type that fast. :)
All of the preceeding command line options MUST be specified before
any files or other options. There is a reason for this: memory
allocation is done at the beginning, and must be performed before the
first files or definitions are created.
-Dname=val
-Uname
These two command line options allow you to communicate with
your m4 program and change its behaviour or perhaps alter
its output from the command line. Within your m4 program you
could test for the existence of the definition for UNIX and
if it were there, you could choose to include a paragraph
about making sure your local System Administrator has
sufficient coffee to drink while on the job, where as if
UNIX is not defined, but DOS is, then it could include a
blurb about regular backups.
This also allows you to override certain settings. For example,
some C compilers do not grok the "void" type of functions.
You might define void to be int for these old-style compilers:
m4 -Dvoid=int ....
That about does it for command line options to m4. Next time we look
at more functions beyond define(). Until then, have fun!
-Andy
*** End of article
---------------
REMINDER - This newsletter is being sent to you 'by request'. If you do
not wish to keep receiving it, e-mail a stop notice to GARS. On the other
hand, we would very much appreciate it if you would pass the word that we
do distribute this item near the tenth (10th) of the month of issue to any-
one on GEnie who requests it.
P L E A S E also remember contributions are most welcome. Please e-mail
items and/or suggestions to GARS.
(EOF)
Trademark and Copyright notices:
Unix is a Trademark of UNIX System Laboratories, Inc.; GEnie, LiveWire, and
RoundTable are Trademarks of General Electric Information Services Company;
Xenix and ms-dos are Trademarks of Microsoft Corporation; NeXT and NeXTstep
are Trademarks of NeXT Computer Systems, Inc., Coherent is a Trademark of
Mark Williams Company, Sun is a Trademark of Sun Microsystems, Inc., Colorado
Memory Systems is a Trademark of Colorado Memory Systems.
The contents of this newsletter are copyright(c) 1992 and may be copied whole
or in part only if original credit is included. The GEnie UNIX RoundTable is
not affiliated with AT&T or UNIX System Laboratories, Inc.