HDTenEightyP/NetNews huggingface dataset:
From: messina@netcom.com (Tony Porczyk)
Subject: Re: Sort problem . .
Date: Fri, 31 Jul 92 13:26:58 GMT
Organization: Messina Software

Mr. etxmesa@eos.ericsson.se (Michael Salmon) writes:
> I have seen very many flexible solutions to problems, many of them
> were even good solutions, for a while at least. The usual result is
> that some time in the future the flexible solution breaks and someone
> has to do it right.

Mr. Tom Christiansen <tchrist@convex.COM> writes:

> Hacking on source is almost always a solution that will come back to
> haunt you.  Sometimes things are so broken you have to fix them, but
> if you just want to munge the output, heroic measures are overkill.

Hm.  Okay, maybe we look at it differently.  I find modifying source
to suit my particular need and then saving another version faster and
*much* easier and more understandable for the future than writing
wrappers that *should* *usually* work.  I don't have to remember to
wrap the stuff as I use it because it does exactly what I want.  
I don't consider it a heroic solution, I consider it an easy one. 

Maybe that would appeal to you more then:

Add one more option, say, "-h" for "header non-sortable", make it
FALSE by default, TRUE if invoked, and change

printf("%s COMMAND\n", hdr);

to

if(hdr_non_sort)
        fprintf(stderr, "%s COMMAND\n", hdr);
else
        fprintf(stdout, "%s COMMAND\n", hdr);

It shouldn't take longer than 10-15 minutes to have it completely
implemented.  Isn't it simpler than writing wrappers and remembering
what needs to be piped through what?  No functionality is lost, some
is added. 

t.

Ps.: I am too agreeable, I know, don't feel quite myself today...

Newsgroups: comp.unix.shell
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: Sort problem . .
Originator: tchrist@pixel.convex.com
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Date: Mon, 27 Jul 1992 14:01:10 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of peer@ccrma.stanford.edu (Peer Landa):
: 
:I'm trying to list & sort all my processes by memory use:
:alias  pss  ' ps uax | sort -nr +3'
:It works fine except for that the "title line" also gets sorted and therefore  
:appears at the bottom . . any idea to avoid this ?

ps axu | ( sed 1q ; sort -nr +3 ) 

--tom

-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist
    If you have ever seen the grim word "login:" on a screen, your mind
    is now a wholly-owned subsidiary of The Death Star.
                John Woods in <14105@ksr.com> of comp.unix.bsd
From: boyd@prl.dec.com (Boyd Roberts)
Newsgroups: comp.unix.shell
Subject: Re: file name completion for ksh?
Date: 22 Jul 92 22:34:59 GMT
Organization: Digital Equipment Corporation - Paris Research Laboratory

In article <m5fmwq.sjs@netcom.com>, sjs@netcom.com (Stephen Schow) writes:
> The ksh is hands down the best.  As the last response showed, there is usually
> a way to do it in the ksh.

The Turing Machine is hands down the best.  There is usually a way to do
it in the Turing Machine...


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
Newsgroups: comp.unix.shell
From: snk@fork.bae.bellcore.com (Samuel N Kamens)
Subject: Re: Sort problem . .
Reply-To: snk@bae.bellcore.com
Organization: Bell Communications Research
Date: Fri, 31 Jul 92 11:26:06 GMT

In article <1992Jul30.214457.28904@prl.dec.com>, boyd@prl.dec.com (Boyd Roberts) writes:
> In article <33pmgah.messina@netcom.com>, messina@netcom.com (Tony Porczyk) writes:
> >
> > I mean, have you ever tried being *flexible* to accomplish your task? 
> 
> I'd rather be _right_ than `flexible'.
> 


Why don't you guys just take it outside and fight it out?

-- 
Sam Kamens					Bell Communications Research
snk@bae.bellcore.com				Phone: (908) 699-7509
444 Hoes Lane  Room RRC 1D-210
Piscataway, NJ 08854
From: boyd@prl.dec.com (Boyd Roberts)
Newsgroups: comp.unix.shell
Subject: Re: Sort problem . .
Date: 31 Jul 92 15:41:44 GMT
Organization: Digital Equipment Corporation - Paris Research Laboratory

In article <rsqmjvp.messina@netcom.com>, messina@netcom.com (Tony Porczyk) writes:
> 
> Hm.  Okay, maybe we look at it differently.  I find modifying source
> to suit my particular need and then saving another version faster and
> *much* easier and more understandable for the future than writing
> wrappers that *should* *usually* work.

The point that Tom and I understand all too well is that sort of argument
doesn't stand up when you've got multiple architectures to support.
Sure, the change may be trivial, but re-compiling and re-installing
a whole swag of binaries can be incredibly time consuming.  And then
you may be faced with doing it all again when you upgrade to a new OS.

Scripts (god forbid -- even perl scripts) save a lot of time because they
don't need to be compiled.  Just one copy into a globally visible bin.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.unix.shell
Subject: Re: file locking in shell scripts
Date: 24 Jul 92 17:25:49 GMT
Organization: NetLabs, Inc.

In article <FRIEDMAN.92Jul24055302@nutrimat.gnu.ai.mit.edu> friedman@gnu.ai.mit.edu (Noah Friedman) writes:
: This is at least one way to (almost) do locking in pure shell script.  I
: suspect other methods are probably more difficult, if not also presently
: impossible.  However, you can write a small C program to do the atomic
: exclusive file creation, returning an exit status that indicates whether it
: succeeded or failed.  Then the rest can probably be done in shell script
: (depending on what else you want to do, that is).
: 
:    Tom or Larry: can perl do this correctly?

I believe exclusive open is actually fairly useless in the presence of
certain Network File Silesystems which shall go unnamed, but perl does
give you access to either flock() or lockf() (the latter via ioctl()).
For a really safe atomic operation, though, use link--I don't think
anyone's found a way to botch that up yet.  But I could become wrong.

Larry Wall
lwall@netlabs.com
From: hodgen@infko.uni-koblenz.de
Newsgroups: comp.unix.shell
Date: 17 Jul 92 11:47 MDT
Subject: Tcsh memory problems
Nf-ID: #N:1992Jul17.074744.28094@infko.uuc:-1412370282:001:1095
Nf-From: infko.uni-koblenz.de!hodgen    Jul 17 11:47:00 1992


Good morning all,

I compiled version 6.02 of tcsh with gcc 1.37 on a Data General Aviion 200 and
get the following error messges dozens of times when I try to use it. It does
start and I can do things but the messages (more or less of them) always
come.

free(435008) above top of memory. (memtop = 435000 membot = 41b998)
free(435018) above top of memory. (memtop = 435000 membot = 41b998)
free(435028) above top of memory. (memtop = 435000 membot = 41b998)
free(435038) above top of memory. (memtop = 435000 membot = 41b998)
free(435048) above top of memory. (memtop = 435000 membot = 41b998)
...

dozens of times. At least 6.02 starts at all 6.01 used to just spit out 
hundreds of these messages then die. Is there a fix for this? I hope someone
can answer this.

Thanks.
-- 
Wayne Hodgen  | hodgen@infko.uni-koblenz.de | Opinions (c) Me 1991   | Intel SX
Uni Koblenz,  | (..!unido!infko!hodgen)     | Keeper of the Scrolls, |  Just
Rheinau 3-4,  | Voice: +49 261 9119-645     | Defender of the Net,   |   say
5400 Koblenz. | Fax:   +49 261 9119-499     | His name is "root".    |    NO!!!

Newsgroups: comp.unix.shell
From: peer@ccrma.stanford.edu (Peer Landa)
Subject: Re: Sort problem . .
Organization: DSO, Stanford University
Date: Wed, 29 Jul 92 16:06:00 GMT


It seems like this is getting out of hand, or drifting away from my original  
posting . . where I asked to get a command line (or script) to list & sort all  
my processes by memory use without getting the "title line" on the bottom --  
i.e the "title line" shall stay at the top (that's why 'ps uax | sort -nr +3'  
doesn't work). One way to do this (thanks to Erick Rudiak) is: 
TITLELINE=`ps aux | head -1`
echo "$TITLELINE"
ps -aux | grep -v PID | sort -rn +3

-- peer

Newsgroups: comp.unix.shell
From: mlei@mona.jpl.nasa.gov (Mary Lei)
Subject: function with cshell script
Organization: jpl
Distribution: JPL
Date: Thu, 30 Jul 1992 22:34:20 GMT

Does any one have an example of how to define a function within a cshell script, like in this borne shell example:

#! /bin/sh 
clean_up()
{
 [ -f $$ftp.script ] && rm -f $$ftp.script
 [ -f $$msg ] && rm -f $$msg

 echo ""
 echo "Please select the \"CONTINUE\" button to continue!"
 cd $opwd
}

#main line
  clean_up
...

_____________________________
Please email me mlei@gina
Thanks.
I am running under SUN OS 4.1.1
From: Harald.Eikrem@delab.sintef.no
Newsgroups: comp.unix.shell
Date: 17 Jul 92 19:55 MDT
Subject: Re: Is it all digits?
Nf-ID: #R:81-m0xl@lynx.unm.edu:1101914314:1992Jul17.195533*Harald.Eikrem@d:1898157342:001:782
Nf-From: delab.sintef.no!Harald.Eikrem    Jul 17 19:55:00 1992


I was going:
! >Oh please Tom, spare him of that crap of yours.
! >
! >To Farid, of course, if you insist on doing these things in c-shell, you
! >will have to learn a couple of c-shell ways of thinking, which includes
! >shell globbing expressions in if and while statements, plus the necessity
! >to quote variables, like:

then enter dylan@ibmpcug.co.uk (Matthew Farwell):
! To Farid, of course, if you insist on doing these things in c-shell, you
! will have to learn a couple of c-shell ways of thinking, which includes
! not using the c-shell to write shell scripts.
! 
! find / -name 'csh' -print | xargs rm -rf
! echo Machine now disinfected.

Matthew, you're a bigger fart than I ever thought. :)

Mind you, I'm not particularly fond of csh programming.....

  ~~harald E.
From: cmylod@nl.oracle.com (Colum Mylod)
Newsgroups: comp.unix.shell
Subject: Re: csh/ksh comparison questions?
Date: 22 Jul 92 14:53:00 GMT
Organization: Oracle Europe

In article <tim.711812407@mal-s1>, tim@mal-s1.gatech.edu (Tim Shelling) writes:
|> >1) set filec or file completion
|> On the command line, go into the vi-editing mode (I don't know how to do
|> this in emacs mode), and place the cursor on the name of the file you want to 
|> expand. Hit '*' which will expand the current filename as if '*' were 
|> appended to it. Or hit '\' and the current word will be replaced with 
|> "the longest common prefix of all filenames matching the current word with
|> an asterik appended." There's a bunch of other nifty things... These features
|> are present in BASH also.
In emacs mode it's all ESC. To list matching filenames/directories but not
complete the current name type ESC=. The emacs equivalent of vi-mode * is
ESC ESC.

|> >2) concurrent sessions inadvertently use the same history
|> >   file.  Appending a pid to the history file at login may help
|> >   but there is no logout facility to remove the file.
|> With KSH you can trap signals and execute programs on reception of
|> those signals. I've seen someone trap the EXIT  
|> signal (or something like that) and have it run a shell, which
|> did exactly that -- it removed a process-dependent sh-history file.
To aviod crashes & untrapped logoffs building up a trail of history files
it's easier to use the tty as part of the HISTFILE name instead of the pid.
An example is HISTFILE=/where/ever/home/is/.hist_`tty | cut -c8-`
(for machines with ttys like /dev/pts001).
From: dla@westford.ccur.com (Dave Anderson)
Newsgroups: comp.unix.shell
Subject: Re: csh/ksh comparison questions?
Date: 22 Jul 92 20:25:17 GMT
Article-I.D.: westford.1992Jul22.202517.16508
Reply-To: dla@westford.ccur.com (Dave Anderson)
Organization: Concurrent Computer Corp. Westford MA.


> 2) concurrent sessions inadvertently use the same history
>    file.  Appending a pid to the history file at login may help
>    but there is no logout facility to remove the file.

  I use the same history file name (".sh_history"), but explicitly remove 
  it in my .profile just prior kicking off my .kshrc.  This unlinks any 
  visible versions of ".sh_history" -- however the "removed" versions are 
  still available to the previous invocation(s) of ksh (as temporary files). 

  Clean and simple...

===============================================================================
  Dave Anderson                                508-392-2441
  Concurrent Computer Corporation              dla@westford.ccur.com
  One Technology Way
  Westford, MA 01886
===============================================================================
From: perl@dwrsun4.UUCP (Robert Perlberg)
Newsgroups: comp.unix.shell
Subject: Re: And the user cried, Features, features MORE featurs!
Date: 28 Jul 92 21:11:25 GMT
Distribution: comp.unix.shell
Organization: Dean Witter Reynolds Inc., New York

In article <QUANSTRO.92Jul24134625@lars.StOlaf.edu>, quanstro@lars.StOlaf.edu (goon) writes:
>     modifiers), which is probablly why Bill Joy did not catch all the
>     bugs (Read csh-whynot).

What is this "csh-whynot" document you refer to and where can I get a
copy?

Robert Perlberg
Dean Witter Reynolds Inc., New York
{murphy | philabs}!dwrsun4!perl
	-- "I am not a language ... I am a free man!"
From: chrish@strl.labs.tek.com (Chris Hubbard)
Newsgroups: comp.unix.shell
Subject: Re: tcsh in the future - what should it be like?
Date: 27 Jul 92 23:56:46 GMT
Reply-To: chrish@strl.labs.tek.com
Distribution: na
Organization: STRL, Tektronix Inc, USA

In article <1992Jul27.215202*Harald.Eikrem@delab.sintef.no>, Harald.Eikrem@delab.sintef.no writes:
|> ! I'd like to see a history mechanism that works like VMS' RECALL, i.e. 
|> ! type something like !vi .cs  and get the last vi command that edits 
|> ! .cshrc.  Simple, powerful concept; only a single command to learn. 
|> 
|> It's there.  You just need to try.

How about  hmmmmm...   esc-p and esc-n    :-)
I think this is default.  (Logical extension to history-back
history-forward.  Kind of like parallel between char-forward and
word-forward in emacs)

And,  if you do the following in your .login or .tcshrc file, meta-p and
meta-n work.  How convient.  :-)

if ( $?prompt ) then
        if ( "`echotc meta`" == "yes" ) then
                 stty pass8
        endif
endif

The above I receive from some knowledgable person posting this group
about six months ago.  What comes around, goes around.


Cheers,

Chris
-- 
Chris Hubbard      chrish@strl.labs.tek.com  | No tread on me   oo0 0oo
Software Technology Research Lab, Tektronix  |                  | | | |
PO Box 500, ms 50-662 Beaverton, OR   97077  | Barefoot Patrol  \_/ \_/
Newsgroups: comp.unix.shell
From: ejh@khonshu.colorado.edu (Edward J. Hartnett)
Subject: dump script rewinds tape - why?
Summary: I don't want this to rewind the tape after it's done
Organization: Cooperative Institute for Research in the Environmental Sciences
Date: Thu, 30 Jul 1992 18:47:02 GMT

This is my incremental dump. I would like to have a week's incremental
dumps on one tape, which I can then leave in there all week. Right now
it rewrites over the backup of the day before (i.e. it rewinds the tape
after backups). But why?

	Ed Hartnett
	ejh@khonshu.colorado.edu

#!/bin/sh
# narrow PATH to trusted dirs
PATH=/usr/ucb:/usr/bin:/usr/etc
# prevent logins during dump
cp /usr/local/etc/nologin /etc/nologin
# will need this later when turning net back on
# warn the unlucky folks already logged in
/usr/bin/wall <<FOOBAR
Incremental dumps will begin in about 5 minutes.  If you are accessing a file
at the same time as dump, that file could be scrogged on the backup, possibly
in your directory on disk, and it is possible that the entire dump could be
scrogged.  Performance will be lousy anyway, so either log out or wait 
patiently for about ten to fifteen minutes or so without typing commands.
If you are remotely logged in, the net connection will be disabled during
the dump which should log you off anyway.   -The Management

PS - You're really working too late anyway. Why don't you get a little rest.
This isn't brain surgery, you know, it can probably wait!
FOOBAR
# give them their 300 seconds
/usr/bin/sleep 300
HOSTNAME=`/usr/bin/hostname` export HOSTNAME
# turn net off to prevent incoming mail, rlogins, rshs, and anything else
# that might disturb the dump
ifconfig le0 down
# rm -fr /tmp/*
/usr/etc/dump 5ubdsf 100 6000 54000 /dev/nrst0 /dev/rsd0a
/usr/etc/dump 5ubdsf 100 6000 54000 /dev/nrst0 /dev/rsd0g
/usr/etc/dump 5ubdsf 100 6000 54000 /dev/nrst0 /dev/rsd0h
# this ensures the tape can't be accidentally overwritten before it is removed
#/usr/bin/mt -f /dev/rst0 offline
# re-enable logins
rm /etc/nologin
# resume connection with the net
ifconfig le0 $HOSTNAME netmask 0xffffff00 broadcast 128.138.0.0 -trailers up
/usr/bin/wall <<RABOOF
The incremental dumps are now complete.  You may resume your work.  Thank you
for your cooperation.   -The Management
RABOOF
Newsgroups: comp.unix.shell
From: yeates@rtsg.mot.com (Tony J Yeates)
Subject: Re: tcsh in the future - what should it be like?
Keywords: tcsh
Organization: Motorola Inc., Cellular Infrastructure Group
Distribution: comp.unix.shell
Date: Thu, 23 Jul 1992 18:15:28 GMT

Tom Christiansen <tchrist@convex.COM> writes:

>From the keyboard of yeates@rtsg.mot.com (Tony J Yeates):
>:	$(command)	-  `command` (speed)

>Not so much speed, I think, as to clean up the quoting rules and 
>make nesting possible.

I hesitate before putting that in.  The Korn book does talk
only about the simplified quoting, but a ksh "guru" friend,
who is apparently in regular contact with Mr. Korn told
me that there was a speed advantage  (or may be it was
just $(< )?.  Simplified quoting is one of the  main reasons
that I prefer to write scripts in ksh (despite being a tcsh user).


>:	$(variablename##pattern)
>:	$(variablename#pattern)	- cut specified short/long pattern off of start/end of variable
>:	$(variable%%pattern)						(versatile, fast)
>:	$(variable%pattern)

>What's wrong with $var:s/foo/bar/, except that it doesn't deal with regexps?

Regular expressions (actually, are these  true regular expressions, 
the normal UNIX regexp rules are not strictly used it seems?)
is the main use of the pattern matching stuff, in my experience.
(Other related csh stuff include the head, tail, etc. operators
that work on paths).

>    set bar = $foo:s/d$//:q

Hadn't seen that before.

>Also: currently :s only works with history, not straight variables.


>:	print	- built in replacement for echo (speed, more versatile, more intuitive name?)

>And to grok \escapes, which have no business in echo.

Sorry, don't understand your banter old bean.

>:More commonality with ksh would be an improvement I think (e.g. use the same symbols
>:shown above, rather than creating new ones, just for the sake of it).
>:
>:2) Leave the command line editing alone - its better thank ksh

>Well, last I checked (not 6.0+) the vi mode in ksh was better than tcsh.

Although I'm a vi user, I always use the emacs-editing mode to
tcsh - its simple, intuitive and quick.  I don't like ksh's
vi mode either.

>Frankly, I think it's hopeless trying to salvage the csh for programming
>use.  I do still prefer tcsh's interactivity to ksh's, however.

I'm not trying to revive csh for scripting, but as it is still used
- I'd like to see it "fully functional" and as compatible/similar
to ksh as possible.  I fully concur with your last statement - tcsh
is, when configured "correctly", is hard to beat as an interactive shell.
I'm very please with it.
>--tom

Newsgroups: comp.unix.shell
From: eric@prodigal.psych.rochester.edu (Eric Hansen)
Subject: Setting variables to ASCII codes in csh scripts
Summary: I need to set variables to ascii escape sequences.
Keywords: CSH ASCII ESCAPE CODES VARIABLES
Organization: University of Rochester - Rochester, New York
Date: Thu, 30 Jul 92 18:03:27 GMT


I'd like to 'echo' a table of variables to standard output, and since
<tab> doesn't always move to the same location on the screen (not in Unix,
anyways), I'd like to do a carriage return (no linefeed), and then move
the cursor right to a specific column.  Sort of like this:

echo -n $CODE1$VAR1
echo -n $CODE2$VAR2
echo $CODE3$VAR3

CODE1 would move over, say, five spaces, CODE2, to the 20th column, and
CODE3 to the 50th column.  Thay way, I don't need to worry about <tab>
putting things in different columns based on the length of the VARiables.

Does anyone know how to set variables to ASCII sequences of escapes and
what not?!  I could just 'echo' them out if it would be easier, but
it seems difficult to embed escape sequences in a file using vi (to put
the clear sequence in an 'echo' statement, I had to 'clear >> FILE' and
then cut and past!).  Also, where can I get a listing of all the vt100
control codes and escape sequences?

Thanks greatly!

- Eric
From: zzassgl@uts.mcc.ac.uk (Geoff Lane)
Newsgroups: comp.unix.shell
Subject: Learning from Unix shell sources
Date: 22 Jul 92 10:29:47 GMT
Organization: Manchester Computing Centre, Manchester, England, M13 9PL.

I want to learn the techniques used to implement Unix shell programs prior
to implementing some ideas of my own.  Which shell sources are best to use
for study purposes? I have access to sh, ksh, csh, tcsh, bash and rc source
code. 

Thanks,
-- 
Geoff. Lane.                                  Janet: zzassgl@uk.ac.mcc.uts
UTS Sys Admin, Manchester Computing Centre, Oxford Rd, Manchester, M13 9PL
Newsgroups: comp.unix.shell
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: file name completion for ksh?
Originator: tchrist@pixel.convex.com
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Distribution: na
Date: Fri, 24 Jul 1992 20:36:22 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of friedman@gnu.ai.mit.edu (Noah Friedman):
:>        And zsh has even more features! Ruf! Ruf!
:
:   Ah yes, features.  What would we do without them?  Probably get more
:work done, instead of endlessly tweaking our environments to no useful end.
:
:   I probably have the most complicated initialization scripts that anyone
:has ever devised (if you don't believe me, email me and we can arrange to
:compare).  One of these days, when I come to my senses, I'll switch to rc
:and use it vanilla.
:
:   Features?  You need features like you need poison ivy. 

Listen to this man.  

Now, I don't want to have an utterly impoverished environment, but 
to a nonzero extent, having more choices can just bog you down.  A 
friend of mine calls this stuff "fritterware", because you waste all
of your time frittering with it.

--tom

-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist


Yes, but every time I try to see things your way, I get a headache.
Newsgroups: comp.unix.shell,comp.unix.questions
From: aldabagh@sal-sun117.usc.edu (Baraa Al-Dabagh)
Newsgroups: comp.unix.shell
Subject: shell programing
Date: 29 Jul 1992 21:41:35 -0700
Organization: University of Southern California, Los Angeles, CA
Distribution: world
NNTP-Posting-Host: sal-sun117.usc.edu


hi
I wanted to ask a simple question:

Any body knows of a good book about shell programing?.
pleas send your answer to:

aldabagh@aludra.usc.edu

Thank you very much.

Newsgroups: comp.unix.shell