home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula
/
nebula.bin
/
Newsletters
/
GEnieUnixNews
/
unxnl-01.91
< prev
next >
Wrap
Text File
|
1993-01-27
|
16KB
|
390 lines
_ __ _ _ __ _ __
// / //| // || \\| N E W S
//_/ // |// || |\\ Vol 2, Issue 1 - January 1991
R o u n d T a b l e
Items of interest to participants of the GEnie Unix RoundTable
The RoundTable SysOps are:
Dave Weinstein......OLORIN Brian Riley.........DELPHI
Gary Smith..........GARS Chris North-Keys....HARP
Rick Mobley.........LRARK 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 - cooperatives sought.
--
In an ongoing effort to make your GEnie Unix RoundTable the resource
you are proud to participte in we have begun a search for cooperative
contributors/participants. These will be groups/organizations who have
meaningful material to present to Unix users, but are not large enough to
support thier own RoundTable. An example which has worked well is the
newsclip area Mitch Wagner of 'Unix Today' maintains. Other concepts
might be a public domain C source repository or a Unix education group.
The qualifying (operative word) contributor must maintain their topic
area and make periodic contributions as appropriate to their topic. In
return we will make a topic available for their use alone.
You can help. If you know of any potential contributors please leave
e-mail to Unixsysops$ with as much information as possible - especially
a phone number and contact would be most helpful. We will pursue the
qualification and extend an invitation if deemed appropriate.
We want this to be the single best public Unix resource available.
Please help us in this quest. Gary gars@glsrk
SAY WHAT ? lead SysOp Dave Weinstein offers this head scratcher:
----------
Sub: Happy New Year
This wins as the single most twisted script I have ever seen...
Would you like a program which sounds equally well
in Bourne Shell, C Shell, C, C++ and even in FORTRAN?
Enjoy!
cat /*dev/null; echo "Happy New Year"\!
cat <<c*/ /*dev/null | cat > /dev/null
c */ () {} /*
c */ main() { cat(); printf("Happy New Year!\n"); } /*
17 format(' Happy New Year!')
write (6,17)
stop
end
c*/
Greetings!
Vadim Antonov
DEMOS, Moscow, USSR
AWK is _NOT_ a BIRD !
---------------------
From the net comes this little exchange on using Messrs Aho, Weinberger
and Kernighan's lexigraphical language. If there is interest in awk()
let me know and we will continue to include awk usage articles in the
newsletter. gars
In article <1543@manta.NOSC.MIL> plantz@manta.NOSC.MIL writes:
>
>I need to use awk to scan a file that consists of lines, each line
>starting with an integer, followed by a line of text that should have
>a period and then a newline character following that. The script should
>save the number>at the beginning of the line, and if the line does not
>have a "period" prior to the "newline", to print out a message, with
>the integer number that was at the beginning of the line.
>
Well, here's a quick solution to your problem. This has been tested on
an AT&T 3B2/1000 running SVR3.2.2.......
Given this text file "testtext":
1 this is a test of this function.
2 i think this is an editing application.
3 it might work in any text processor, though
999 a troff-like system could also use this stuff.
and this script:
#!/bin/sh
#
# hack out and validate lines preceded by integers.
awk '{ linenum = $1;
if (index($NF,".") == 0) {
printf("Error in line %d; no period\n",linenum);
} else {
print;
}
}' testtext
You get this output:
1 this is a test of this function.
2 i think this is an editing application.
Error in line 3; no period
999 a troff-like system could also use this stuff.
If you need some more help, feel free to get in touch. I don't claim
that this is an elegant solution, but it's the old "top-of-the-head"
solution.....
O'Reilly and Associates have just published "sed & awk", the newest
of their Nutshell handbooks. It's easy to read, and includes many
working scripts, 10 of which were submitted by Usenet readers.
--
| Wes Morgan, not speaking for | {any major site}!ukma!ukecc!morgan |
| the University of Kentucky's | morgan@engr.uky.edu |
| Engineering Computing Center | morgan%engr.uky.edu@UKCC.BITNET |
Lint is the compiler's only means of dampening the programmer's ego.
------------------
FAST and NASTY, DOWN and DIRTY: quick fix scripts that do something
--------------------------------
lowercase tr script:
-------------------
>From rick (lrark). script to change UPPERCASE filenames to lowercase
Thought I might dig up some tidbits for the newsletter. Here is a nice small
script that seems useful for filenames that come across in upper case.
-- Usenet message begins --
I think all the programs posted so far have the bug that if you have
files called "x" and "X", they will delete one of them. Here's mine.
Doesn't disturb files whose names already contain any lowercase
characters (thus preserving names like "Makefile"), and even has online
help! Not shar'd, cut out and use.
#! /bin/sh
# converts to lowercase
if test $# -lt 1; then
echo "usage: lfname file ..."
echo "(specified filenames are converted to lowercase)"
exit 1
fi
for f in "$@"
do
case "$f" in
*[a-z]*)
#echo "skipping $f, contains lowercase chars"
;;
*)
newname=`echo "$f" | tr 'A-Z' 'a-z'`
if test "$newname" != "$f"
then
if test -f "$newname"
then
echo "$newname already exists"
else
mv "$f" "$newname"
fi
fi
;;
esac
done
exit 0
--
Rahul Dhesi <dhesi%cirrusl@oliveb.ATC.olivetti.com>
UUCP: oliveb!cirrusl!dhesi
For us Xenix folks there is one line that needs to be changed.
change: tr 'A-Z' 'a-z'
to: tr [A-Z] [a-z]
works like a charm..
rick@lrark
Microport users will also need to use the bracketed arguments. gars
timed.sh :
--------
Study this script - closely. Run it. Play with it. You will profit by
learning a LOT about some script commands that may be obscure to you
and should not be. gars
#!/bin/sh
delay=60
trap 'trap 14' 14
echo "What is your Quest? \c"
(sleep $delay; kill -14 $$ 2>/dev/null)&
read YourQuest
kill $! 2>/dev/null
[ ! -z "$YourQuest" ] && echo "Bah. Humbug. Not interested in $YourQuest" \
|| echo "You must be interested in something!"
BUILDING your PLATFORM:
----------------------
CONFIGURATION ( fellow SysOp Brian Riley (delphi) continues his discussion
on how to customize the U/A on a Unix system using a 3b1 as his model)
* editor's note: part 1 of this series is available in UNXNL-10.90
posted in library 1 of the GEnie Unix RT software libraries.
---------------
Customizing the User Agent (tm)
on the Unix Pc (tm)
by Brian T. Riley
Part 2
Welcome back folks! This month we will continue to explore the
wonderous world of the User Agent. We will examine the structure and
purpose of Suffixes, Preferences and Environment. And for
those of you using 3.51 , or higher, of Unix on your systems and don't
have the Calendar package, you are in for a treat because...
Surprise!! It's already there! Your UA just doesn't know it yet. :)
(It may be there in 3.5 but I personally can't remember that far back.)
In fact, let's start there first. Ok? Here we go.
Last month we modified the UNIX System menu object to give us a
dimensionless window to the Unix command line. From the Office menu
select Unix System and you should recieve the standard $ prompt
without the border. If you are logged into the system from a terminal
instead of the Console then you should execute the following command
first;
$ clear <return>
Next we need to find the files we need for the Calendar. Type in the
following commands;
$ cd /etc/fixes <ret>
$ ls -l <ret>
$ cp pcal /usr/bin <ret>
$ cp pcal.hlp /usr/lib/ua <ret>
$ cd $HOME <ret>
Ok, now we have the files where we want them, but, the UA still
doesn't know they are there. In order to set this up properly, we will
need to modify two files, Office and Preferences. Let's start with the
Office file. Exit back to the UA and select Home from the Office menu.
Now Open the Office file. If you did everything right last month you
should see the contents of the Office file in your favorite editor.
What? You say it doesn't look right? You probably still have "ed" set
as your default editor. So, type a "q" and hit return. Now, select
Preferences from the Office menu. Then select Office. You should now
see several options here. You may wish to experiment with the settings
before we go on, just don't forget to refresh the Office menu after
you change something. The option we are looking for right now is the
Default Editor: line, which should say "/bin/ed". For right now let's
change it to "/usr/bin/vi" and later you can change it to something
else if you wish. Now press Enter and do a refresh. Then select the
Home object and Open the Office file. If you get an error you will
need to install the Enhanced Editors disk that came with your system
or use annother editor. For the rest of this article I will assume we
are all using the vi editor.
We need to add a new object to the Office file for the Calendar. To do
this, add the following lines to you Office file;
Name= Calendar
Default= Open
Open= EXEC -d /usr/bin/pcal -c
Help= EXEC -d /usr/bin/uahelp -h /usr/lib/ua/ua.hlp -t Calendar
We also want to be able to change the default features of the Calendar
so we need to copy the Preferences file to our Home directory and edit
it. Add these lines to your new Preferences file;
Name= Calendar
Default= Open
Open= EXEC -d /usr/bin/pcal -p
Help= EXEC -d /usr/bin/uahelp -h /usr/lib/ua/ua.hlp -t Calendar
As you can see, the Preferences file is set up the same as the Office
File, but, is only usefull for programs that allow customizing. One
difference is that for changes in the Preferences file to take effect
you must logout and login again. You may be wondering what other
programs you can set up Preferences for. Well, if you use the Korn
Shell, Vi, Elm or just want to modify your .profile more easily you
can do this;
Name = Vi Editor
Default = Open
Open = EXEC -wd /usr/bin/vi $HOME/.exrc
And substitute the appropriate Name= value and .filename in the Open=
value. As you can see, the User Agent can be very flexible.
The Suffixes file defines descriptions for files that have a specific
suffix such as :Am for a modem profile, and what to do with them when
they are selected from the UA. The structure of the Suffixes file is
simmilar to Office but is used differently. The minimum required
information is Name=, Description=, Default=, and whatever keyword is
defined as default. Here is an example;
Name=Installable File
Suffix=+IN
Description=*Installable File
Default=Open
Open=SH -pw /usr/bin/Instcpio.sh %o
Create= ERROR
Help=EXEC -d /usr/bin/uahelp -h /usr/lib/ua/admin.hlp -t "Email
Software"
There are a couple things we should mention here. Namely the "*" in
the description and the value of Create. The "*" indicates that when
the file is displayed in the UA the suffix will be left off of the
file and just the description will be used to identify it. The ERROR
in Create= tells the UA that this type of file cannot be created from
within the UA and the user should be notified.
Finally, the Environment file is created when a user changes the
values in the Office object from Preferences. However, it can be a
little more usefull than that. Even though the Preferences menu for
Office only shows the options that it has built in, the Environment
file can contain additional variables that will only be set when the
user logs in and the UA is run. If you wish to set other environment
variables you can add them to the Environment file in your home
directory, but you must do it manually.
In closing I should mention that the modifications we have made are
only in effect for your login but they can just as easily be made
system wide by modifying the master files in /usr/lib/ua. However, you
will need superuser priveledges in order to do it. Next time we will
explore the wonders of the Korn shell, make it possible to decide
between the UA and the command line from our login, and examine the
structure of an Installable file. Have a good month! ;)
WHO: meeting members of the Unix RT (this one needs to be flame resistant)
----
To all who may have reason to enter into a friendly wager with our
illustrious leader and otherwise nice guy, Dave Weinstein... DON'T !
I really like Dave, and he really is trustworthy in all other areas
of our acquaintance, but he just can NOT seem to bring himself to
comply with a simple, fun, gentleman's wager.
It is once again basketball season. That is what prompted the issuance
of this little missive. You may recall we had a basketball season a
year ago, also. Seems like ages ago, doesn't it ? Anyway, in that long
ago basketball season of 1990 Dave lived in the city of Austin and I
in Little Rock. You need to live in one of those two cities to truly
appreciate the dire consequences of our wager, but suffice it to say
there is not a great deal of love and affection between fans of the
University of Texas Longhorns and fans of the University of Arkansas
Razorbacks.
The wager was simply this... whoever's team lost the Southwest Conference
Championship Tourney had to wear the cap of the other school in public
and provide photographic proof of compliance.
Texas and Dave lost, and to this day - ten months later - I have yet to
see any such photo(s) though they have been promised several times; and
Dave now lives in Denver. Well, his residence is in Colorado. Obviously,
his sense of sportsmanship still resides in Texas. gars
O-o-o-o-o-o Pig ! Sooie ! RAZORBACKS !!
---------------
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 each month to anyone on
GEnie who requests it, and will gladly add any name that is requested via
the same route... e-mail to GARS.
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 AT&T; GEnie, LiveWire, and RoundTable are Trademarks
of General Electric Information Services Company; Xenix is a Trademark of
Microsoft Corporation; Unix Today is a Trademark of CMP Publications, Inc.,
Microport is a Trademark of Microport Systems, Inc.
The contents of this newsletter are copyright (c) 1991 and may be copied whole
or in part only if original credit is included. The GEnie UNIX RoundTable is
not affiliated with AT&T.
ay be copied who