HDTenEightyP/NetNews huggingface dataset:
From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
Subject: Re: why use eval?
Summary: eval is your pal
Organization: Rensselaer Polytechnic Institute, Troy, NY
Date: Sat, 15 Aug 1992 05:00:52 GMT

I W Scott Barker writes:
>> What is the significance of using eval `[command]`? The man pages state that
>> this runs the command [command] in the shell. Does not simply typing the
>> command alone accomplish the same thing?
>
>I believe I have figured out the use of eval. The back-quotes around a command
>cause that command to be executed in a sub-shell, after command/filename/
>variable substitution, and the resulting output is passed back to the shell as
>text. No further substitution is performed on that text. If, however, the
>back-quoted command is an argument to eval, substition IS performed on the
>resulting text. Thus, for example:
>
>alias ls 'ls -Fa'
>set foo=ls
>`echo $foo`
>
>results in a "simple" ls being performed, while
>
>alias ls 'ls -Fa'
>set foo=ls
>eval `echo $foo`
>
>results in an ls -Fa being performed, since eval caused further command
>substition to be performed.
>
>Is this correct?

I think so

Another application of eval is the expansion of variables which contain
metacharacters intended for interpretation interpreted by the current
shell.

For example (sh):

pipe="deroff -w | uniq -d"
$pipe

fails with
Deroff: |: No such file or directory

But:

eval $pipe

works fine.

As another example, the presence of the ";" in 

export TERMCAP TERM;
TERM=vt100;
TERMCAP='d0|vt100 ...

(the output of "tset -s") requires that tset be invoked as

eval `tset -s ... `

and not merely

`tset -s ... `

Brian
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.questions
Subject: Re: Simple AWK question.....
Date: 20 Aug 92 18:37:58 GMT
Organization: Auspex Systems, Santa Clara

>This works under AIX 3.1.5 with ksh and I hope under other BSD like OS, too.
>Under SYS V like OS you'll get twice the amount of kB, which is weird,
>but ...

Err, AIX 3.2, at least, isn't "BSD-like" in that regard, it's System
V-like, not surprisingly; its "du" reports the number of 512-byte
chunks, not the number of 1024-byte chunks.

SV-like "du" commands don't *report* the number of kB, they report the
number of half-kB.
Newsgroups: comp.unix.questions
From: christo@bcarh803.BNR.CA (Mark Christopher)
Subject: Re: Associative arrays in [gn]awk --whynot! (long but interesting)
Reply-To: christo@bnr.ca
Organization: Bell-Northern Research Ltd.
Date: Fri, 21 Aug 1992 15:26:22 GMT

In article <1992Aug15.021954.27159@news.acns.nwu.edu>,
navarra@casbah.acns.nwu.edu (John Navarra) writes:
|>In article <1992Aug14.173952.12112@mccc.edu> pjh@mccc.edu (Pete
Holsberg) writes
|>>In article <1992Aug13.063348.11691@news.acns.nwu.edu>
navarra@casbah.acns.nwu.edu (John Navarra) writes:
|>>=======================
...
|>>=Basically, associative arrays in gn[awk] are 
|>>=unreliable (especially for a multi-field file).
|>>
|>>Unreliable? In what way?
|>
|>	With respect to order being read in. Obviously, many of you know
|>that this is a well-known bug. Some do not. However, gawk, which you may
|>expect to print out the values correctly (i.e in numerical order) only 
|>prints those values correctly if the file is in numerical order in the first 
|>place. This is not always going to be the situation! 

I think you are assuming too much.  As far as I know, associative arrays
have _never_ been guaranteed to be ordered.  Let me dig out my Awk book by
A, W, and K, and see what it says (dig dig dig dig)...

"The AWK Programming Language", Alfred V Aho, Brian W Kernighan,
                     Peter J Weinberger, 1988.  ISBN 0-201-07981-X

  p.50: "The characteristic that sets awk arrays apart from those in
         most other languages is that subscripts are strings."

  p.51: "  for (variable in array)
                 statement
        This loop executes _statement_ with _variable_ set in turn to
        each different subscript in the array.  The order in which the
        subscripts are considered in implementation dependent.  Results
        are unpredictable if new elements are added to the array by
        _statement_."

This last quote makes it pretty clear that what you describe is not a
bug, it's a feature.


...
|>	and this is not the correct order either. I *want* the output to
|>be printed in the *same* order it was read in!!! Now tell me how to do
|>that with sort if the numbers aren't in some order sort understands?
|>Now see where the problem is?

Not a problem.  Let me dig out an applicable quote here:

   Any problem in computer science can be solved with one more level of
   indirection.                -- Morven's Metatheorum


Have fun...
-- 
Mark Christopher        Bell-Northern Research          christo@bnr.ca
From: berman@nlm.nih.gov (Lew Berman)
Newsgroups: comp.unix.questions
Subject: grep for number of character string
Date: 18 Aug 92 14:03:46 GMT
Reply-To: berman@nlm.nih.gov
Organization: National Library of Medicine

How can I determine if a value is a string or an integer within a 
bourne shell script?  For example, if a file exists such that
each line may contain a number (integer) or a string (which can
be alpha-numeric) how do I determine which it is?  That is to say,
if I cat the file into an argument and then run this data through a
for loop how do I test each element?

Example shell script:
#! /bin/sh
data=`cat $1`

for i in $data
do

	.....test for integer of alphanumeric string.....
	
done


Example data file:

345
5467
234
2
3
456
730
aabbccdd
sffeetr$%^
4566KKLKLK		<- not a number
lij56			<- not a number
 
 
 
 



Please respond by sending me e-mail.

Thanks,

Lew Berman
National Library of Medicine
Newsgroups: comp.unix.questions
From: frank@D012S436.sniap.mchp.sni.de ()
Subject: Re: Alarm() and children
Organization: Siemens-Nixdorf AG
Date: Fri, 21 Aug 92 10:14:44 GMT

ccechk@nuscc.nus.sg (Heng Kek) writes:
: If I have a program which spawns 20 children almost simultaneously
: (i.e. via a loop) and arrange for a SIGALRM to be delivered after
: 'x' seconds in each of the children,  will the signal in one child
: affect other children?
: 
: The alarm() is called in each of the children.
: 

No, each process has an independent alarm.  I think you also need
to set up the signal handler *after* the fork.  

Btw, Watch out for the library call 'sleep', it uses alarm().
It will cancel any outstanding alarm  - I spent several hours
looking for that one the first time I came across it!


Hope this helps,
--
Frank O'Dwyer		       			Disclaimer: 
Siemens-Nixdorf AG 	                        I will deny everything
Tel.  : +49 (89) 636-40639                      Fax.  : +49 (89) 636-45860
e-mail: Frank.ODwyer@sniap.mchp.sni.de
From: simony@ccs.northeastern.edu (Simon Yeung)
Newsgroups: comp.unix.questions
Subject: Question about date.
Date: 19 Aug 92 02:39:24 GMT
Distribution: usa
Organization: College of Computer Science, Northeastern University
Originator: simony@sun3160a.ccs.northeastern.edu


I am writing a C shell script in which the user enter a number n
and the script needs to find the date which is the nth day before
the current date.  Can I do this by using some Unix commands?

I don't want to write a program for it, unless I have to.

Thanks.

--Simon
Newsgroups: comp.unix.questions
From: twpierce@amhux1.amherst.edu (Tim Pierce)
Subject: Re: Can I use LN03 on Unix for TeX?
Organization: Amherst College, Amherst MA
Date: Thu, 13 Aug 1992 03:38:03 GMT

In article <1992Aug11.162437.2007@syma.sussex.ac.uk> nealet@syma.sussex.ac.uk (Neale Type) writes:

>Does anyone know of a dvitoln03 driver to be used on a Unix based
>system?

This question is probably more appropriate for comp.text.tex.
However, I have one which works on our Suns, and claims to work on
Ultrix and other little-endian machines as well.  I can mail it to you
or anyone interested (93K uuencoded .tar.Z).

-- 
____ Tim Pierce                / "Bisexual just means you pay for it."
\  / twpierce@amherst.edu      /  
 \/ (BITnet: TWPIERCE@AMHERST) /   -- Rock Hudson
From: LABELLES@zeno.mscd.edu (Stephen LaBelle - MSCD)
Newsgroups: comp.unix.questions
Subject: The tcsh shell
Date: 20 Aug 92 18:14:51 GMT

Hello Folks,

Can anyone elighten me about the shell tcsh. Up until about 10 minutes ago
I had never heard of it. Now I have a user asking about it, I do not have
it on my HP-UX system, but I am curious as to what it is???

Is it by any chance another name for the kourne shell.

Please respond directly to me, I do not read this list.      


							Thanks in Advance,

							Steve


##############################################################################
# Stephen LaBelle                        # Internet : labelles@zeno.mscd.edu #
# Systems Programmer                     #            labelles@clem.mscd.edu #
# Metropolitan State College of Denver   #####################################
# Denver, Colorado  USA                  # Bitnet   : LABELLES@MSCD.BITNET   #
##############################################################################
Lightning never strikes twice in the same place unless your insurance lapsed!
Newsgroups: comp.unix.questions
From: cudcv@warwick.ac.uk (Rob McMahon)
Subject: Re: Changing file names
Organization: Computing Services, Warwick University, UK
Date: Sat, 22 Aug 1992 15:11:38 GMT

In article <1992Aug21.135128.20589@news.eng.convex.com> tchrist@convex.COM
(Tom Christiansen) writes: 
>:for i in `ls`
>:do
>:  echo $i | sed s/xyz// >j
>:  mv $i `cat j`
>:done
>:rm j
>
>Process pig.  Why not
>
>    mv $i `echo $i | sed 's/^xyz//'`
>
>Also, your method is going to earn you a lot of
>
>    mv: foo and foo are identical
>
>errors.

Minor critism :-)  you failed to criticise the "for in in `ls`" when he could
have done "for i in *", or in this case "for i in xyz*".

I think we've come down to

for i in xyz*
do
  mv "$i" "`echo \"$i\" sed 's/^xyz//'`"
done

Oops.  I seem to have slipped another critism in (not enough quotes).  I hate
scripts that can't deal with arbitrary filenames.  This is one of the good
points of {,t}csh, with its $var:q.

Cheers,

Rob
-- 
UUCP:   ...!mcsun!uknet!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             INET:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
From: brennan@ssc-vax.boeing.com (Mike Brennan)
Newsgroups: comp.unix.questions
Subject: Re: A few UNIX questions (sed+awk)
Date: 12 Aug 92 18:11:27 GMT
Organization: Boeing Computer Services


In article <20619@sbsvax.cs.uni-sb.de>, uwe@mpi-sb.mpg.de (Uwe Waldmann) writes:

| > In article <1992Aug5.235701.17614@pbhyf.PacBell.COM>
| > skataba@pbhyf.PacBell.COM (Sam Atabaki) writes:
| > >2. I want to write a little "sed" script (I don't have perl) to
| > >   edit patterns of the following forms:
| > >      xyz abc <abcd@xy.com> kjkjkj
| > >      xyz abc <abcd@xy.com>
| > >   such that the <> are removed and anything delimited by <> be
| > >   moved to the beginning of the line. So after the edit the two
| > >   lines above will look:
| > >      abcd@xy.com xyz abc kjkjkj
| > >      abcd@xy.com xyz abc
| > 

| The following code is more reliable (and it's only one process):
| 
|   sed -e 's/^\(.*\)<\(.*\)> *\(.*\)$/\2 \1\3/'
| 
| By the way, the sed+awk solution in article <118390003@hpcupt3.cup.hp.com>
| by aakash@hpcupt3.cup.hp.com (Aakash Sahai) is even worse:  It also fails
| if the <...> part is not enclosed by whitespace or if it is followed by
| more than one word.  Why do so many people believe that string substitution
| problems can be solved most easily using awk?

Because it is often easy, for example, this problem with an up to date
version of awk as defined in 1988 AWK book:

awk  'BEGIN{ FS = " *<|> *"} ; { print $2, $1, $3 }'

--
Mike Brennan
brennan@boeing.com
From: roehrich@cray.com (Dean Roehrich)
Newsgroups: comp.unix.questions
Subject: Re: problem with vi..
Date: 19 Aug 92 14:35:03 GMT
Organization: Cray Research, Inc.

In article <1992Aug19.051418.15684@nmsu.edu> jhall@dante.nmsu.edu (HALL) writes:
>Since you have a sparc workstation I see that you use SunOS.
>Dos files do use a different carriage return than the sun.

No, they do not use different carriage returns.  There is only one kind, and
Unix generally doesn't use it :)



Dean Roehrich
roehrich@cray.com
Newsgroups: comp.unix.questions
From: amol@aix3090b.uky.edu (Amol Deshpande)
Subject: Re: dumping text to a local printer attached to a terminal?
    <1992Aug12.142109.12980@swbatl.sbc.com>
Organization: University Of Kentucky, Dept. of Math Sciences
Date: Thu, 13 Aug 1992 21:57:43 GMT

rollins@oktext.sbc.com (Steven D. Rollins) writes:

>>I realize that this is probably an RTFM-type question, but would someone please
>>be so kind as to tell me how it's done?  I'm using my personal computer over
>>a dial-up line in vt100 emulation mode, and would like some of the stuff I'm
>>working on to be able to dump output directly to a locally-attached printer
>>(...and would like to be able to do it generically from the termcap, as the
>>software is to be used by others and will not always necessarily be used
>>with a vt100 emulation).
>>-- 
>>| Douglas J Renze            

>	This little script might work for you, it does for me. The first
>	line turns on vt100 print-pass-thru. the second cats your file to
[rest deleted]

you could also ftp PCPRINT.C from wuarchive.wustl.edu. I'm not sure exactly which directory it's in. It does some more fancy stuff like allowing interrupts , etc. Or send mail to amol@aix3090b.uky.edu and I'll mail you my copy.

-Amol
--
     --------------------------------------------------------------------
    | "I refuse to be intimidated by reality any more. What is reality ? |
    |  Nothing but a collective hunch "      - Lily Tomlin               |
     --------------------------------------------------------------------
From: news@ptt-iat ( Pete)
Newsgroups: comp.unix.questions
Subject: Re: Raw Partition V/S File for Database -- Opinions Please.
Keywords: Informix on IBM RS6000
Date: 18 Aug 92 12:14:12 GMT
Organization: PTT Telecom I&AT Groningen

In article <Aug.17.15.26.10.1992.6170@gauss.rutgers.edu> manmetha@gauss.rutgers.edu (Rajesh Malhotra) writes:
>
>	Is it advantageous to have a raw partition for a database or
>should a file system be used as a database chunk? I would like to hear
>pros and cons on this matter.
>
>	Any advantages of one method above the other?


We have a couple of HP boxes with Oracle and a few Unisys machines with
a DBMS called MAPPER. We have run test with and without raw partitions. The
test showed an average improvement of aprox 15 - 20 % in speed when we used
raw partitions. But we decided to go for normal filesystems 'cause the problems
of back-up and restoring raw-partitions doesn't fit into our back-up
scheduling.

Summary:
raw is faster, but normal filesystems are better manageable.


Peter van der Kooi
peter%ptt-iat@relay.nluug.nl



Newsgroups: comp.unix.questions
From: gordon@osiris.cso.uiuc.edu (John Gordon)
Subject: Re: csh foreach question
Organization: University of Illinois at Urbana
Date: Sat, 15 Aug 1992 02:04:21 GMT
Keywords: csh,foreach


	Thanks for all the responses.

John
Newsgroups: comp.unix.questions
From: jmarten@cix.compulink.co.uk (Jonathan Marten)
Subject: Resilient Unix systems
Reply-To: jmarten@cix.compulink.co.uk
Date: Fri, 14 Aug 1992 20:31:13 +0000

My company has a requirement for a resilient unix system; we have an 
application which takes a very long time (*several days*) to run, *BUT* the 
local power is rather flaky and is likely to fail (or at least be subject to 
severe fluctuations) during that period.
 
We don't consider it practical to have an operator in attendance to restart 
the job after a power failure, so we wondered.........
 
Is there any unix machine which can save all the jobs that were running when 
the power fails, so that when power is restored they can just carry on from 
where they left off?
 
Does anyone have any experience of such systems?  Any comments??
 
Thanks in anticipation,
Jonathan Marten             jmarten@cix.compulink.co.uk
From: dwatney@pine.circa.ufl.edu (Marshall Sutherland)
Newsgroups: comp.unix.questions
Subject: Porting from PC to NCR Tower
Date: 17 Aug 92 15:41:46 GMT
Reply-To: dwatney@pine.circa.ufl.edu
Organization: University of Florida  (ufl.edu)
News-Software: VAX/VMS VNEWS 1.3-4

Hi,

We are in the final testing phases of an application which we have developed
on a PC platform under SCO Unix.  Our first really big potential customer
is asking for a demonstration on their system.  Problem:  their systems 
run on NCR Towers.

My questions are:
1) Will we find that source compatibility is a myth?  (It's a pretty
simple program.  Mostly standard C and curses calls.)
2) We don't really want to come out and say "uh, it doesn't run on your
system yet".  Is it possible to rent a full development system for a
minimal amount of time in order to recompile it?  
3) What does a minimal usable NCR Tower cost?
4) Any other words of wisdom?

Thanks,

-----
Marshall Sutherland, Digital Magic Software Development, Inc.
dwatney@pine.circa.ufl.edu, dwatney@ufpine.bitnet, 0@arms.uucp, arms!0
Sysop, Farthinghale Arms BBS, +1 904 378 4861
From: ifc@cactus.org (Wolf Metzner)
Newsgroups: comp.unix.questions
Subject: Questions for Tex and e-mail
Date: 20 Aug 92 18:06:57 GMT
Distribution: comp.unix.questions
Organization: Capital Area Central Texas UNIX Society, Austin, Tx

Hello UNIX experts,

I have two questions that I would like to get some answers for; if you
know the answers, please send an e-mail to me at:	milan@cactus.org

1) I am told the Tex is a public domain text processing package.  If so,
from WHERE and HOW can i load it on to my computer (a UNIX box).

2) I have seen people including standard footers to their mail messages,
can you tell me how can I define a footer once and then regularly
include it in my mail messages.

I would appreciate your responses to this query.


thanks in advance,

milan patel

reply to: milan@cactus.org
From: C.R.Ritson@newcastle.ac.uk (C.R. Ritson)
Newsgroups: comp.unix.questions
Subject: Re: dump/rdump in single-user
Date: 21 Aug 92 08:33:52 GMT
Organization: University of Newcastle upon Tyne, UK, NE1 7RU

jyacc!dtroxell%aspen@uunet.uu.net (Dan Troxell - SysAdm (NE)) writes:

>	'... on a quiescent system.'

>This means you will lose updates to files made after the 'dump' takes it's
>inode count.

There are cirtain pathological conditions that can cause more
seriously unusable dump tapes, in rare circumstances. The "quiescent
system" bit is important. See the following articles:-

	"Issues in On-line Backup" Steve Shumway, Sun-Soft.
	"Torture-testing Backup and Archive Programs: Things you ought
	to know but probably would rather not" Elizabeth D Zwicky, SRI
	International.

Both of these were published in the LISA-V proceedings by the Usenix
association.

>One way around this is to simply distribute the file /etc/nologin to
>all systems. A check for this file's existence takes place during every
>login attempt -- if it exists, it displays its text ( like motd ) and boots
>the user out.

That is fine, but you must also prevent "rsh yourmachine xterm", which
is how I start all my xterm sessions. You might like to investigate
stopping or killing inetd too.

Chris Ritson.
EMAIL: C.R.Ritson@newcastle.ac.uk       Chris Ritson,
PHONE: +44 91 222 8175                  Department of Computing Science
FAX  : +44 91 222 8232                  University of Newcastle upon Tyne,
TELEX: uk+53654-UNINEW_G                UK, NE1 7RU
Newsgroups: comp.unix.questions
From: erbas@slump.ssc.gov (Cengiz Erbas)
Subject: Non-blocking I/O in UNIX
Keywords: I/O
Reply-To: erbas@slump.ssc.gov (Cengiz Erbas)
Organization: Superconducting Super Collider Laboratory
Date: Wed, 12 Aug 1992 18:11:26 GMT

I would like to read character input from the keyboard without requiring the user
to press the return key. But, I do not want to use the "curses" library.
Any help is appreciated. Please e-mail I am not a regular user of the USENET.

Thanks in advance.

Cengiz Erbas,
e-mail: erbas@slug.ssc.gov

Newsgroups: comp.unix.questions
From: dleroy@mitchell.cit.cornell.edu (David J LeRoy)
Subject: ifconfig question
Nntp-Posting-User: @cornell.edu
Organization: Information Technologies/Network Resources; Cornell University;
	Ithaca, NY, USA
Distribution: comp.unix.questions 
Date: Thu, 13 Aug 1992 17:44:59 GMT

Can someone explain to my why when I "ifconfig <interface> down", the
route previously created to that interface and is in the routing table

A) remains in the table

and more importantly

B) keeps the U (up) flag intact.


Thanks


Dave LeRoy
dleroy@mitchell.cit.cornell.edu
Newsgroups: comp.unix.questions
From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
Subject: Re: Changing file names
Organization: Rensselaer Polytechnic Institute, Troy, NY
Date: Fri, 21 Aug 1992 06:07:57 GMT

Jon Bosak writes:
>
>Suppose I have a directory containing files named, for example,
>
>      xyz920815a ...
>
>...and so on.  I want to change the names of these files to
>
>      920815a ...

A wise system programmer at RPI decided that the campus user shell will
be bash, regardless of the vendor platform (thanks, Scanner!).  A bash
solution (like the ksh solution posted by someone else.) is

for i in xyz* ; do mv $i ${i#xyz} ; done

To me, this is simple enough to type from memory without using aliases
or shell scripts.

For testing, I usually type

for i in xyz* ; do echo mv $i ${i#xyz} ; done

and look at the echo output.  If it looks ok, I type ^echo to actually
run the command.  On the other hand, if the echo prints something
unexpected, I just press the uparrow key, edit the command line, and
try again.

To changes suffixes, instead of prefixes, try, for example,

for i in *.c ; do mv $i ${i%.c}.o ; done

Bash is available for free from lots of places.  Check archie.

Brian
From: 880126b@dragon.acadiau.ca (Chris Butler)
Newsgroups: comp.unix.questions
Subject: Faking an EOF
Keywords: sockets
Date: 20 Aug 92 13:23:05 GMT
Organization: Acadia University

OK, here goes...

I'm writing an application that gets the output of a command across 
a socket.  What I want to do is to be able to have a loop on the
client side like this:

while(fgets(buffer, BUFSIZE, f) != NULL)   /* f is a file descriptor
                                            * that reads from the socket.
                                            */
   print("%s", buffer);


On the other end of the socket, I do a popen() and read from the
file descriptor and throw everything into the socket. 

What I want is some ioctl or fcntl thing that will "fake" an EOF
on the socket so fgets will recognize it, but still be able to 
use the socket afterwards.  Is this possible?  Please e-mail, and
I'll summarize if there's any interest.

-Chris

-- 
Chris Butler                                   chris.butler@dragon.acadiau.ca
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     "Then you admit confirming not denying you ever said that?" 
     "NO! I mean Yes! WHAT?"  "I'll put `maybe.'" -- Calvin & Hobbes
Newsgroups: comp.unix.questions
From: kgermann@zeos.com (Ken Germann)
Subject: UUCP and Windows Sizes
Organization: Zeos International, Ltd. 
Date: Fri, 14 Aug 1992 03:04:08 GMT


There are instructions in the man pages for changing the 
packet sizes for SCO' uucico. If I follow the instructions
exactly as stated, I get a symbol not found error. Anyone
have any Ideas? I would like to stay with the current
version of UUCP shipped with SCO.

Ken
-- 
  	   New! ZEOS 486 Upgradable VESA Local Bus Motherboard.  

			   info@zeos.com
Ken Germann		support@zeos.com 	Zeos International, Ltd.