HDTenEightyP/NetNews huggingface dataset:
From: dansmith@Autodesk.COM (Daniel Smith)
Newsgroups: comp.unix.shell
Subject: Re: testing for arguments in aliases
Date: 15 Aug 92 22:26:13 GMT
Organization: Autodesk Inc., Sausalito CA, USA

In <1992Aug9.041528.10720@jade.tufts.edu> rdorich@jade.tufts.edu (Rob) writes:

> Hi there netters,
>   No too long ago I started using arguments within aliases.  I was
> wondering if some one could tell me how to test for an argument within
> an alias.  eg. if we had:
> alias foo 'test for 1 arg and do'
> ...

	Ok, at this point, you're starting to want more functionality
out of an alias than what can conveniently be jammed into one line.
By "convenient" I mean: something you can go back to in a week and
grasp/edit, without trying to recall every last one-liner trick in the
book when you're in a hurry :-)

	Try passing the args to a variable, and then have the alias
source a script.  With that you can spread the logic out over a few lines
if need be.

	Here's an encore presentation of my newdir alias/script
combo.  This checks for args, and makes a new directory.  When the directory
is made, we move any other files/directories specified on the command
line to it, and pushd there.  This ties together the 3 most common things
I like to do when I make a new directory.

	The alias:

alias   newdir  'set newdir_attempt=(\!*); source ~/bin/newdir_csh'

	easy so far... $newdir_attempt will "pass" our args for us.

	The ~/bin/newdir_csh script which does the work:

#!/bin/echo sorry,try:source
if ($#newdir_attempt == 0) then
        echo 'usage: newdir dir_to_make [files to move to dir_to_make]'
        goto nd_end
endif
 
mkdir $newdir_attempt[1] || goto nd_end
set cd_attempt=$newdir_attempt[1]
if ($#newdir_attempt > 1) then
        shift newdir_attempt
        mv -f $newdir_attempt $cd_attempt
        unset newdir_attempt
endif
pl $cd_attempt   # substitute your favorite pushd alias here...
 
nd_end:

	The $#newdir_attempt line at the top gives us a way of checking
to see that there were some args.  We also do a check farther down to see
if we should move any files/directories to the newly created directory.

	Note that by sourcing a script, you buy yourself the ability
to change your csh environment, and you also have the opportunity
to embed bits of perl or sh in a "here document", etc.  It's amazing
what can be accomplished with a one-line alias, and I've written
some real lulu's myself.  With the onset of age though (ripe old 31),
I no longer want to take all afternoon debugging silly one-line csh things,
and prefer "spelling it out" in a script.  I now reserve time for debugging
silly lines of perl :-)

				Daniel
-- 
            dansmith@autodesk.com            dansmith@well.sf.ca.us
        Daniel Smith, Autodesk, Sausalito, California, (415) 332-2344 x 2580
              Disclaimer: written by a highly caffeinated mammal
 $|=1;for("..."," hacker"," perl"," a","just"){print $l=$_.$l,"\015";sleep 1;}
From: boyd@prl.dec.com (Boyd Roberts)
Newsgroups: comp.unix.shell
Subject: Re: recursive mkdir
Date: 20 Aug 92 21:17:32 GMT
Organization: Digital Equipment Corporation - Paris Research Laboratory

In article <1992Aug20.052006.536@physiol.su.OZ.AU>, john@physiol.su.OZ.AU (John Mackin) writes:
> [Boyd: it was psych44.]
> 

Still running after all these years.  John Holden has done well.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
Newsgroups: comp.unix.shell
From: chetal@is.morgan.com (Pradeep Chetal)
Subject: Re: isatty in Korn shell
Organization: Morgan Stanley & Company
Date: Thu, 13 Aug 1992 06:57:44 GMT

In article <683mp4q.bryan@netcom.com> bryan@netcom.com (Bryan Higgins) writes:

   How can I test in a Korn Shell script if standard input is a tty?

if test -t 0; then
    echo stdin is a tty
else
	echo foo bar
fi

/Pradeep
--
----------------------------------------------------------------------------
Pradeep Chetal                                          Phone: 81-3-3286-9678
Information Services Deptartment                          FAX: 81-3-3286-9040
Morgan Stanley Japan Ltd.  Tokyo Branch            E-mail: chetal@is.morgan.com
        Ote Center Bldg. 3F, 1-1-3 Otemachi, Chiyoda-ku, Tokyo 100
Newsgroups: comp.unix.misc
From: sears@tree.egr.uh.edu (Paul S. Sears)
Subject: Re: animated file
Reply-To: sears@tree.egr.uh.edu
Organization: University of Houston
Date: Thu, 13 Aug 1992 17:34:59 GMT

In article <1992Aug6.090652.12834@cucs5.cs.cuhk.hk> khchan@eng.ie.cuhk.hk  
(chan ka hei) writes:
=>Hello everybody,
=>
=>   I have once see an animated email, a characters-made train move 
=>from left to right and some trinkets on a tree blink.
=>   I have also once seen an animation when I try to 'finger ' a guy.
=>   It seems that we could embed some commands in a normal file and the 
=>content of the file will be processed by those command when the file is
=>'cat'ed or displayed by anyway.
=>   Anyone know how to create the animation or the embedding-command
=>technik?
=>
=>   Please let me know by email. Thanks.
=>   
=>   Best Regards.
=>   Frank Chan      khchan@eng.ie.cuhk.hk
=>
=>   wear to die is better than rust to die....


Sure, finger me at sears@menudo.uh.edu to see a rather lengthy text  
aninmation...

I used the program called "asp" and I fed the output into my .plan file...
From the README file:

> *** Documentation for "asp v3.2, The .plan description language"
> (c) Alec Muffett, September 1991
> 
> As detailed in the demonstration programs (just type 'make'), this is
> "asp", Alec's Scrolling Program, a diddy little hack I put together to
> finish a war over who could make the longest, best, and prettiest
> ".plan" files, using only the printable ascii character set.
> 
> Asp is a simplistic description language for carriage-return based ascii
> animations, as commonly found in ".plan" files when you finger someone.
> It is simple to use, so large, smooth, neat animations can be built
> quickly and easily, and with a lot of room for imagination.
> 
> The language is crude, I haven't put together a decent lexical analyser,
> there is no real parser as such, to whit, it is a realio trulio hack, as
> stated before.
> .
> .
> .
> Bugs, reports, suggestions, patches to the address below...
> 
>                                                 alec 8-)
> --
> INET: aem@aber.ac.uk      JANET: aem@uk.ac.aber      BITNET: aem%aber@ukacrl
> UUCP: ...!mcsun!ukc!aber!aem         ARPA: aem%uk.ac.aber@nsfnet-relay.ac.uk
> SNAIL: Alec Muffett, Computer Unit, Llandinam UCW, Aberystwyth, UK, SY23 3DB
> 
 
--
Paul S. Sears                *  sears@uh.edu (NeXT Mail OK)
The University of Houston    *  suggestions@tree.egr.uh.edu (NeXT
Engineering Computing Center *  comments, complaints, questions)
NeXT System Administration   *  DoD#1967 '83 NightHawk 650SC 
          >>> SSI Diving Certification #755020059 <<<
"Programming is like sex: One mistake and you support it a lifetime."
Newsgroups: comp.unix.misc,comp.sys.sun.misc,comp.unix.programmer
From: swanger@ducvax.auburn.edu
Subject: Curses/Sun problem
Organization: Auburn University, AL
Date: Fri, 21 Aug 1992 14:31:30 GMT

I am writing a program that uses curses (Sys V) to capture information from
the keyboard.  I am using a SUN Sparcstation IPC, with SUNOS 4.1.2.  I can't
seem to get unique values for some of the keypad keys.  If I press any of
the cursor (arrow) keys, I get a value that is consistent with the values
listed in the curses(v) man pages under SYSTEM V FUNCTION KEYS.  However, if
I press any other key on the keypad, a unique value is not returned.  All I
seem to get for any of these keys is a lowercase 'z'.  Actually, I suspect
some sort of escape sequence that ends (or begins) with 'z' is being
returned.  Still, I am using the curses keypad() function that I thought
would cause these keys to return a unique value, not a sequence.

I have included the program below.  I compile and link the program with the
following command:

/usr/5bin/cc -I/usr/5include -L/usr/5lib -o ctest ctest.c -lcurses -ltermcap

-----------------------------cut here-------------------------------------
#include "curses.h"

main()
{
   int key, finished;
   WINDOW *input;

   finished = FALSE;

   if ((int)initscr() == ERR)
   {
      exit(0);
   }

   refresh();

   input     = newwin(LINES,COLS,0,0);
   wrefresh(input);

   cbreak();
   noecho();
   nonl();
   intrflush(input, FALSE);
   keypad(input, TRUE);

   while(finished == FALSE)
   {
      wmove(input,0,0);
      wrefresh(input);
      key = wgetch(input);
      wmove(input, 1, 0);
      wprintw(input, "%c     ", key);
      wmove(input, 2, 0);
      wprintw(input," %o  %d    ", key, key);
      wrefresh(input);
      if (key == 'x') finished = TRUE;
   }

   delwin(input);
   endwin();
}
-----------------------------cut here-------------------------------------

Thanks in advance for any help you can send!
-- 
David Swanger,   Auburn University, Alabama,   swanger@ducvax.auburn.edu 
Newsgroups: comp.unix.misc
From: dark@microsoft.com (Dar Korra'ti)
Subject: WARNING: <mc> Drive not found - hah?
Date: 17 Aug 92 23:54:05 GMT
Organization: Microsoft Corporation
Reply-To: dark@microsoft.com
Followup-To: dark@microsoft.com
Distribution: na
Keywords: INTERACTIVE UNIX, INSTALL, SENDMAIL, <NC>, HANG

[]
     Hi ho... I was wondering if somebody could help me with this weird
problem I'm having with a newly installed Interactive Unix setup. It comes
up fine, with one warning:
     WARNING: <mc> Drive not found
     This warning started appearing after initial installation. At the same
time it appeared, sendmail stopped working. I can build a sendmail.fc file,
but as soon as I try anything else, the sendmail task hangs. (It's killable,
of course, but it doesn't _do_ anything.) Even test mode fails.
     I am really rather confused about all this, because I can't find
anything else wrong with the machine. All the partitions seem fine, no
problems with drive access, everything's where it should be (as far as I
can tell - I'm not a .wizard tho'), TCP/IP works, all the TCP/IP utilities
work, the rest of the basic mail system _seems_ to work...
     Anyway, clues - particularly about what that warning really means -
would be appreciated. Followup and Reply fields set to point to me since
I doubt most people would care - change them if you like.
                                                  - R'ykandar.
--
dark@microsoft.com | install panic - attempting to dump 5243 pages to floppy
From: israel@risky.Convergent.COM (Paul Israel)
Newsgroups: comp.unix.misc
Subject: Re: Troff and thesis-writing (Help !)
Date: 17 Aug 92 16:23:13 GMT
Organization: Unisys Unix Systems Group, San Jose, CA

From article <41375@ogicse.ogi.edu>, by natarsu@mse.ogi.edu (N. Sukumar):
> 
> 	Is there any on-line help for troff (text
> formatter), especially in regard to thesis-writing ?
> There are macros for preparing the table of contents;
> how about list of figs/tables ?  Would like to get the hang of
> page numbering (Roman/Italics) at the bottom-center.  I
> doubt if any text formatter can be worse than troff :-)

   Most of the online help you're likely to find consists of the
man pages used for invoking the troff/tbl/eqn/pic programs. As far as
using them is concerned, you're best bet is to track down a Unix user's
supplementary manual which provides the necessary tutorials and
reference guides. My personal favorite is the BSD4.3 Unix User's
Manual Supplementary Documents (USD), although my edition does not
include a description of pic. If you're very lucky, some of these
documents may be online on your system, especially if it's BSD.

   As far as thesis writing is concerned, I've always found the -ms
macro package to be the most useful. I would think it is possible to
use the table of contents macros they provide to also generate a
list of figures; if not, I suppose you could always generate one using
a tbl construct.

   I don't know how to number pages with an italics font, but to generate
Roman numerals on the bottom of the page, you could do this:

	.af PN i
	.ds CF "- % -

   Perhaps something like this might work for italics:

	.af PN i
	.ds CF "- \fI%\fR -
	
-- 
Paul Israel -----------------  israel@risky.convergent.com
Senior Smartypants ----------- Unisys Corporation, San Jose, California
Disclaimer: "Who, me? I wasn't even there!"
From: pollansw@cse.fau.edu (Warren Pollans)
Newsgroups: comp.unix.misc
Subject: mac to unix xmodem transfer
Date: 20 Aug 92 19:53:23 GMT
Organization: Florida Atlantic University, Boca Raton, FL, USA

I can use some help.  I am unable to successfully transfer files
from my mac SE to a sunOs machine using the 'sx'/'rx' or 'sb'/'rb'
commands on the Sun.  Sometimes I encounter transmission errors
(according to my program - RedRyder) after 2048 bytes, sometimes
after 12 1K blocks.  I can't make any sense out of it.  the message
shown with the rx/sx commands is:

	3.11 02/26/91
	for v7/BSD by Chuck Forsberg
		Omen Technology ...

I have no trouble transferring files using Kermit -- I thought that
the xmodem 1K blocks would be faster.

Any suggestions would be appreciated.  I have been told that few,
if any, people have been able to upload via xmodem.

Thanks,

Warren

(pollansw@cse.fau.edu)
Newsgroups: comp.unix.misc
From: jlu@unislc.uucp (Jesse Urena)
Subject: Re: Wanted: support software for UPS (uninterruptable power supply)
Organization: Unisys Corporation SLC
Date: Thu, 20 Aug 1992 03:58:41 GMT

From article <jke.714210295@tko.vtt.fi>, by jke@tko.vtt.fi (Kemppainen Jukka):
> 
> is there a public domain software available that supports
> UPS (uninterruptable power supply) connected to unix workstation?
> That is, a software deamon or a process which checks the serial
> port once a while for CTS and other signals? Those signals are
> used by the UPS to tell the computer about power failure and
> power is up again.
> 
I'd have to check the back issues for the specific date, but 
Unix World had an article with a C program that allowed a 
UPS sense cable a connection to a serial port. In the event 
of power loss it would execute the shutdown script. 
Let me know if you can't find it, I'll look through my stack.
-- 
Jesse Urena     |
Unisys          |       UUCP     {hpda,sun,uplherc}!unislc!jlu
322 N. 2200 W.  |       internet jlu@unislc.slc.unisys.com
SLC, Ut 84116   |       voice    801.594.7038
Newsgroups: comp.unix.misc
From: s9054960@rkw-risc.cs.up.ac.za ()
Subject: Re: Process in background
Date: 17 Aug 92 14:07:20 GMT
Organization: University of Pretoria, South Africa

Thanks all,
  for the replies.

Gregory Knott.
Newsgroups: comp.unix.misc
From: swanger@ducvax.auburn.edu
Subject: Re: /tmp problems ...
Organization: Auburn University, AL
Date: Thu, 20 Aug 1992 18:29:37 GMT

In article <1992Aug19.152902.1@ducvax.auburn.edu>, swanger@ducvax.auburn.edu writes:
> In some of our public SUN Sparcstations, the /tmp subdirectories keep
> filling up with "temporary" files until the file system is full.  These

I have received several suggestions that I use the the find command to find
(and delete) all unwanted files in /tmp.  Thanks for all of the suggestions!
-- 
David Swanger,   Auburn University, Alabama,   swanger@ducvax.auburn.edu
From: thong@usc.edu (Tony Hong)
Newsgroups: comp.unix.misc
Subject: UNIX tutorial
Date: 13 Aug 1992 14:37:02 -0700
Organization: University of Southern California, Los Angeles, CA
Distribution: world
NNTP-Posting-Host: aludra.usc.edu

Does anyone have any good ascii UNIX tutorials or reference sheets?
I'm looking for something geared towards the beginner to intermediate
level. I'm not looking for books; just something short and simple.  
Please e-mail any responses.  Thanks.

Tony
From: s9054960@rkw-risc.cs.up.ac.za
Newsgroups: comp.unix.misc
Subject: Process in background
Date: 14 Aug 92 14:09:57 GMT
Article-I.D.: rkw-risc.s9054960.713801397
Organization: University of Pretoria, South Africa

Hi, I am a new UNIX user, and was wondering if it is possible to run 
a process in the background. I would also like to know the command
to be used and the syntax.

Thanks in advance.

Reply to : 9054960@rkw-lan.cs.up.ac.za

Gregory Knott.
From: jenny@garland.bt.co.uk (Jennifer Evans)
Newsgroups: comp.unix.misc
Subject: Lex++
Date: 12 Aug 92 09:41:52 GMT
Organization: British Telecom Labs

Can anyone tell me if it is possible to have more than one lex++
process active at once? and if so how?

Thanks in advance

jenny
Newsgroups: comp.unix.misc,comp.unix.questions
From: dave@saguaro.uucp (Dave Challis)
Subject: QA tools wanted
Date: Fri, 14 Aug 1992 23:55:22 GMT
Organization: Stratus Computer Inc.

I'm looking for tools to do automated QA testing of unix applications.
Any suggestions or experiences with commercial or shareware products
would be greatly appreciated.

Thanks


-- 
Dave Challis
uunet!saguaro!dave	VOICE (714) 770-1304
dave@saguaro.uucp	FAX   (714) 863-0461 
Xref: sparky comp.unix.misc:3246 comp.unix.questions:10108 comp.unix.xenix.sco:2690 comp.unix.sysv386:13199
From: jochen@busybit.mrz.sub.org (Jochen Fahrner)
Newsgroups: comp.unix.misc,comp.unix.questions,comp.unix.xenix.sco,comp.unix.sysv386
Subject: Re: Cannot login on any tty :-( - HELP!!!
Date: 12 Aug 92 16:59:39 GMT
	<Bsq6tE.79t@immd4.informatik.uni-erlangen.de>
Organization: Busybit's Software Labor, D-8068 Pfaffenhofen
X-Md4-Signature: 0514c45ea98f7debc837f42f3bb2e0dd

In article <Bsq6tE.79t@immd4.informatik.uni-erlangen.de> jmastel@immd4.informatik.uni-erlangen.de (Joachim Astel) writes:

   [At last I was able to enter the system by patching /etc/inittab
   on my harddisk... I had to change "/etc/getty tty11" to "/bin/sh
   >/dev/tty11 2>&1 </dev/tty11", to start a shell on a multiscreen
   after boot time, though single-user mode was also not working
   anymore (because of the same reason with /dev/tty)...

How do you have done that without logging in ?

Jochen
-- 
Jochen Fahrner, D-8068 Pfaffenhofen, jochen@busybit.mrz.sub.org
Newsgroups: comp.unix.misc,alt.religion.computers
From: kilroy@acme.gen.nz (earthbound misfit, I)
Subject: Re: The need for an assembler (was: Favorite CPU)
Date: Wed, 19 Aug 92 10:33:47 GMT
Organization: ACME BBS - Public Access Usenet, Palmerston North, New Zealand

spc@pineal.sci.fau.edu (Sean 'Captain Napalm' Conner) writes:

> peter@ferranti.com (Peter da Silva) writes:
>
> >spc@pineal.sci.fau.edu (Sean 'Captain Napalm' Conner) writes:
> >>   -spc (Unix philosophy:
> >> 	1. Write cryptic and highly customizable code.
> >
> >Write simple code. Write small modules that hang together well. Write your
> >code as generically as possible... one day you'll have to port it.
>
>   And find is simple?  dd is small?  Gee, I'd like to have your Unix system
> at work 8-) 8-) (add many many more if needed)

All find does is apply a series of tests to all files in a given directory
branch. And you even have to specify those tests as *whole words*. Sounds
pretty simple to me.

As for dd:

	$ ls -l /bin/dd
	-r-x--x--x  1 bin       bin            9676 Wed Aug  5 20:41 /bin/dd
	$ 

10k sounds small enough to me.

						- k
						(using Coherent 3.2.1a)
-- 
Craig Harding            kilroy@acme.gen.nz             ACME BBS +64 63 3551342
"Jub'f Xvob?"
Xref: sparky comp.unix.misc:3260 alt.religion.computers:471
From: spc@pineal.sci.fau.edu (Sean 'Captain Napalm' Conner)
Newsgroups: comp.unix.misc,alt.religion.computers
Subject: Re: The need for an assembler (was: Favorite CPU)
Date: 17 Aug 92 18:54:47 GMT
Organization: Florida Atlantic University, but who cares?

(If this ends up in alt.folklore.computers, then I did something wrong 8-)

In article <id.2PCS._X2@ferranti.com> peter@ferranti.com (Peter da Silva) writes:
>In article <1992Aug12.173328.7160@cybernet.cse.fau.edu> spc@pineal.sci.fau.edu (Sean 'Captain Napalm' Conner) writes:
>>   -spc (Unix philosophy:
>> 	1. Write cryptic and highly customizable code.
>
>Write simple code. Write small modules that hang together well. Write your
>code as generically as possible... one day you'll have to port it.
>
  And find is simple?  dd is small?  Gee, I'd like to have your Unix system
at work 8-) 8-) (add many many more if needed)

>> 	2. Never write original code.  Find some that's close, and force it.
>
>I've seen some of that.
>
>> 	3. Never write C.  That's what Awk and Perl and Bourne Shell are for.
>
>If an interpreted language is fast enough, sure.
>
>> 	4. Never write Assembly.  That's what C is for.
>
>If a compiled language will do the job, sure.
>I've got assembly modules in some of my current code, but it's pretty
>hairy stuff.
>
>> 	5. Never remove code.  #ifdef it out.
>
>I don't hold with this. If I change the functionality of a routine, all
>the ifdeffed stuff is either brought up to date or dyked out.
>
>> 	6. Write sloppy code.  The compiler will optimize for you.
>
>Write good algorithms before you worry about micro-optimisation.
>
>> 	7. Never worry about memory.  It's virtual anyway.
>
>Oh, this is the MIT/Berkeley philosophy. Don't check the return code of
>malloc. Assume your network is fast and your workstations are slow.
>
  Hmmmm, that's funny, because I always check the return code of
malloc, my computer is fast, but the network is kinda slow ...

>> 	8. If it's not running Unix, it's not a real computer.
>
>If you can't run UNIX code on it, it's not a real computer.
>
  Can you run UNIX code on the Amiga?  You can run C code written
with the Standard C Library on the Amiga, PC, Unix, etc, but not
UNIX code, per say.

  A person I know doesn't consider the Amiga to be a REAL COMPUTER(TM)
because it doesn't run Unix.  I don't consider the 386 to be a real
processor because it's a deranged 8/16/32 bit mutant CPU from 1980
(well, based on a deranged CPU from 1980, I should say) 8-) 8-) 8-)

>>       (Personally, I can't stand the Unix philosophy 8-) 8-)
>
>I can't stand people confusing MITnix with UNIX.

  -spc (And I can't stand people that defend a 20 year old
	OS that's about as many patches, kludges, fixes and scotch
	tape as a certain 10 year old OS for PC's, but only
	100 times larger 8-) 8-) 8-) 8-) 8-)

P.S.  Add a 8-) after EVERY word.  Letter, if it would make you
      feel better.
Newsgroups: comp.unix.misc
From: jdell@nefertiti.mit.edu (John Ellithorpe)
Subject: Re: mac to unix xmodem transfer
Organization: Massachusetts Institute of Technology
Date: Fri, 21 Aug 1992 15:53:04 GMT

On 20 Aug 92 19:53:23 GMT, pollansw@cse.fau.edu (Warren Pollans) said:

> I can use some help.  I am unable to successfully transfer files
> from my mac SE to a sunOs machine using the 'sx'/'rx' or 'sb'/'rb'
> commands on the Sun.  Sometimes I encounter transmission errors
> (according to my program - RedRyder) after 2048 bytes, sometimes
> after 12 1K blocks.  I can't make any sense out of it.  the message
> shown with the rx/sx commands is:

> 	3.11 02/26/91
> 	for v7/BSD by Chuck Forsberg
> 		Omen Technology ...

> I have no trouble transferring files using Kermit -- I thought that
> the xmodem 1K blocks would be faster.
>
> [...stuff deleted...]

Actually, the versions of kermit I have do support 9K packet sizes.  We have
C-Kermit 5A(170), if that helps, which runs on our Sun SPARCs.  The latest
version of Kermit for the Mac, I think, supports the larger packet sizes 
also.

I've tested this and the larger packet sizes do save quite a bit of time.

--John
--
===============================================================================
John Ellithorpe                           | Internet: jdell@maggie.mit.edu
Dept. of Physics, Rm 26-349               | Phone   : (617) 253-3074  Office
Massachusetts Institute of Technology     |           (617) 253-3072  Lab
Cambridge, MA  02139                      |           (617) 236-4910  Home
===============================================================================
Newsgroups: comp.unix.misc