Summary: Disks, displaying lines # thru # in a file

Ju-Lien Lim (julienlim@rocketmail.com)
Thu, 22 Jan 1998 14:52:21 -0800 (PST)

My thanks to everyone who responded on my two
questions, i.e. disks and displaying certain lines in
a file (below is the summary).

Ju
julienlim@rocketmail.com

================================================

Original Question (Subject: Disks):

I'm looking for recommendations from anyone
who can tell me what kind of *inexpensive* disks are
out there that can is over 4 Gigs that I can use on
Sparc 10, Sparc 20 which Online Disksuite (ODS) will
also support in terms of mirroring and RAID and will
not require a great deal of configuration in terms of
the O/S recognizing the disk.

SUMMARY:
========
Venkat D (venki21@hotmail.com):

The Best solution will be to buy from SUN but they
are bit expensive.
There are lots of companies which sell SUN drives
like Artecon,
Boxhill. The chasis and the power supplies are
different but
the disk is either from Seagate or Connors!!
As far as the ODS is concerned .. it is a software
raid so
it will not cause anyproblem if the O/S has
recognised the
Disks.

D.J. Gregor" (dj@gregor.com):

Any disk should work. I HIGHLY suggest that
you
evaluate the performance of your application and disks
that you are looking at purchasing. I've bought some
cheap disks in the past figuring "Hey, it's just
storage
space", and I have come to regret it because I have a
number of slow, old, clunky disks. I HATE when I have
to access data that is on these things. Just make sure
that you get drives of the same model so that their
characteristics will be the same, or else mirroring
and RAID will not perform optimally.

---------------------------------------------------------------
Original Question (Subject: Displaying lines # thru #
in a file):

Also... is there another way I can displaying lines
500-540 of a file from the prompt (sort of like `head
-540 | tail 40` )

SUMMARY:
========

mike@trdlnk.com (Michael Sullivan)
charest@chou.CANR.Hydro.Qc.Ca (Claude Charest)
Tim Pointing (Tim.Pointing@dciem.dnd.ca)
Stephen Harris (sweh@mpn.com)
D.J. Gregor (dj@gregor.com)
Charles Seeger (seeger@cise.ufl.edu)
Jay Lessert (jayl@latticesemi.com)
Rich Kulawiec (rsk@gsp.org)
Joseph S. D. Yao (jsdy@cais.com)
Ray Smith (rcsmith@csc.com)
Karl E. Vogel (vogelke@c17mis.region2.wpafb.af.mil)
Jochen Bern (bern@TI.Uni-Trier.DE)

sed -n -e '500,540p' filename
sed -n -e 500,540p
sed -e '1,499d' -e '541,$d'
sed -e '1,499d' -e '540q'
head -540 /etc/termcap | tail -40 | more
head -540 < /etc/termcap | tail -40 | more
(head -540 | tail -40) < /etc/termcap | more
tail +500 | head -40

One problem with this is that, after the lines are
printed, sed will
continue to read lines from the file (which is going
to use up lots of
CPU time etc if the file is large.)

This is kind of nasty--pipe it through "sed
'500,540p;d'".
Literal translation "print lines 500-540, delete all
lines".
Every line ends up getting deleted by the "d"
command, however
lines 500-540 are printed before they are deleted, so
the
command works. Please note that sed isn't the
fastest thing
around, and I think that your "head -540 | tail 40"
is probably
the fastest solution using shell scripting. If other
people
have interesting suggestions, I wouldn't mind hearing
about
them, either through a SUMMARY or through private
E-mail.

Another solution would be to use awk...

awk 'NR<520 {next} {print} NR==540 {exit}'

This will exit after printing the desired lines.

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com