HDTenEightyP/NetNews huggingface dataset:
From: john@physiol.su.OZ.AU (John Mackin)
Subject: Re: recursive mkdir
Summary: Sequent busted the shell
Reply-To: John Mackin <john@civil.su.oz.au>
Organization: Department of Physiology, University of Sydney, Australia
Date: Thu, 20 Aug 1992 05:20:06 GMT

In article <1992Aug18.161744.27823@u.washington.edu>,
	donn@carson.u.washington.edu (Donn Cave) writes:

> The script you posted fails under DYNIX 3.1, on a Sequent Symmetry: [...]
> This is basically a BSD 4.2 system, and the shell is so old that not only
> does it lack shell functions, it also behaves a bit different with separator
> characters.  My recollection is that it specifically exempts "/" from the
> separator characters when expanding expressions, for some reason.
>
> | IFS="/$IFS"

Donn,

I won't come out and flatly say `I don't believe you,' but I don't
believe you :).

I don't doubt that the script does fail on the system you mention in
the way you say.  What I _don't_ believe is that any real, un-hacked
Bourne sh ever worked like that.  You see, my native machines these
days are DECstations running Ultrix.  Their /bin/sh is an extremely
primitive version as well, also straight out of 4.2BSD.  It works fine
with that sh.

Not being the kind of guy who is easily satisfied, I decided I would
_really_ check this out.  You might be surprised to learn that there
are still PDP-11s running Seventh Edition up and working on this
campus.  Furthermore, I have an account on one (smiles shyly).  I
just logged in there and checked this, and I can assure you that
a V7 sh on a PDP-11 does NOT treat / in IFS specially.  [Boyd:
it was psych44.]

This allegation caused me some concern, since I make it my business to know
the history of the commands, especially crucial ones like sh, and know
what is portable and what isn't.  I'm very pleased to have found in this
case that I did have the history correctly in mind.  What I didn't know
here is that Sequent broke the version of sh that they shipped with DYNIX
3.1.  I'm not too upset about that, having never logged in to a
Sequent Symmetry.

Moral: the script _is_ properly portable.  Complaints to your vendor. :)

-- 
John Mackin <john@civil.su.oz.au>
`Flood pinging the broadcast address should only be done under very
 controlled conditions.'  -Mike Muuss
Newsgroups: comp.unix.shell
From: rgh@pern (Richard G. Hash)
Subject: Re: Octal chmod status
Organization: Shell Oil
Distribution: na
Date: Thu, 20 Aug 92 16:15:28 GMT

>It took me mere seconds to write the perl solution.  It requires
>no separate a.out and source code, and can be easily embedded in 
>a shell script if you want.  How long does it take you to write
>the C code, compile it for every single architecture on which it
>might run, then copy the binary around to every machine you want
>to run it on?  

This tends to ignore how long it takes you to compile and install
perl on every machine you want *it* to run on...

Let's see, I have to worry about sun{3,4}, hp9000s{3,7,8}00, dec3100,
Cray YMP, Ncube, RS6000, Apollo, Amhdahl UTS, VAX (Ultrix), and I'm
sure there's some others I can't recall right now. Yup, use 'em all, all
the time.  Gee Tom, if you could just ship me some ready-to-install
perl distributions for ALL those machines I'll being using it tomorrow.

Face it, perl isn't everywhere (though I would like for it to be),
and it's not *always* the answer to everything.

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

-- 
Richard G. Hash
Shell Bellaire Research Center, Houston TX
email: rgh@shell.com    ph: (713) 245-7311
Newsgroups: comp.unix.shell
From: boyd@prl.dec.com (Boyd Roberts)
Subject: Re: recursive mkdir
Organization: Digital Equipment Corporation - Paris Research Laboratory
Date: Tue, 18 Aug 1992 13:04:37 GMT

In article <1992Aug18.033048.7574@physiol.su.OZ.AU>, john@physiol.su.OZ.AU (John Mackin) writes:
> 
> I append to this message a _portable_ recursive mkdir written in plain
> vanilla sh.  As an added bonus, it even has error checking!  Gosh!
> 

Funny things is that a (simplified) version of this script was published
with the original UNIX paper(s) indicating one of the drawbacks of being
able to do exactly that.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
Newsgroups: comp.unix.shell
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: Exit status of command executed by rsh
Originator: tchrist@pixel.convex.com
Date: Thu, 20 Aug 1992 14:36:23 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
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 thomson@zarda.macc.wisc.edu (Don Thomson):
:I'm executing commands on a remote machine using rsh in a Bourne shell script
:and then want to test the exit status of the remote command.  Of course, after
:the rsh, the exit status is that of the rsh executed on my machine rather than
:the command executed on the remote machine.  Is there a particularly
:slick/elegant way to pass back and test the exit status from the remote
:machine?

Yup, you use the wonderful ersh command from 
Maarten Litmaath <maart@na47sun05.cern.ch>.  
I'm not sure that this is the current version.

--tom

#!/bin/sh
# @(#)ersh 3.0 91/06/04 Maarten Litmaath
# This rsh front-end returns the exit status of the remote command,
# or 99 if the connection is broken prematurely.
# It works OK with sh/csh-compatible shells on the remote (!) side.
# If there is no remote command present, rlogin is invoked, which
# need not return a meaningful exit status.
# Usage: see rsh(1).

RSH=/usr/ucb/rsh
RLOGIN=/usr/ucb/rlogin

hostname=
lflag=
nflag=
user=

case $1 in
-l)
	;;
*)
	hostname=${1?'hostname expected'}
	shift
esac

case $1 in
-l)
	lflag=-l
	shift
	user=${1?'username expected after -l flag'}
	shift
esac

case $1 in
-n)
	nflag=-n
	shift
esac

case $hostname in
'')
	hostname=${1?'hostname expected'}
	shift
esac

case $# in
0)
	exec $RLOGIN $lflag $user "$hostname"
esac

id=ersh.$$.`date | awk '{ print $4; }'`
hangup=99

AWK='
	prprev == 1 {
		print prev0;
		prprev = 0;
	}
	$1 == "'$id'" {
		prev0 = $0;
		prev2 = $2;
		prev3 = $3;
		prprev = 1;
		next;
	}
	{
		print;
	}
	END {
		if (prprev == 0) {
			exit('$hangup');
		}
		if (prev2 ~ /^[0-9]+0$/) {
			exit(prev2 / 10);
		}
		if (prev2 ~ /^0$/ && prev3 ~ /^[0-9]+$/) {
			exit(prev3);
		}
		exit('$hangup');
	}
'

exec 3>&1

cmd="( ${*-:} ); exec sh -c 'echo $id "'"$0 $1" >&2'\'' $?0 "$status"'

$RSH "$hostname" $lflag $user $nflag "$cmd" 2>&1 >&3 3>&- |
	awk "$AWK" >&2 3>&-
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist

"The number of UNIX installations has grown to 10, with more expected."
    - _The UNIX Programmer's Manual_, Second Edition, June, 1972.
Newsgroups: comp.unix.shell
From: mpalmer@encore.com (Mike Palmer)
Subject: How can process cd to a dir and stay there when exits
Date: Thu, 20 Aug 1992 12:33:55 GMT
Organization: Encore Computer Corporation

Can anyone suggest a way for a process to cd to a dir & stay there when the \
process exits.

I have a ksh solution using an alias, a script & the program, but I'd like
to do it just with a program, or at least a script & program than will work
under csh & ksh.

Any ideas gratefully accepted.
From: dansmith@Autodesk.COM (Daniel Smith)
Newsgroups: comp.unix.shell
Subject: Re: csh echo newlines
Date: 19 Aug 92 18:31:28 GMT
Distribution: na
Organization: Autodesk Inc., Sausalito CA, USA

In <1992Aug19.041937.14932@novell.com> tporczyk@novell.com (Tony Porczyk) writes:

> wb8foz@skybridge.SCL.CWRU.Edu (David Lesher) writes:

> >How do I get a csh echo statement to output a newline?
> >All the book examples talk about supressing them. I want one!

> echo ""

	And if you want a lot of them, try:

	echo 'line 1=line 2=line 3' | tr '=' '\015'

				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;}
Newsgroups: comp.unix.shell
From: wb8foz@skybridge.SCL.CWRU.Edu (David Lesher)
Subject: csh echo newlines
X-Post-Machine: skybridge.scl.cwru.edu
Organization: NRK Clinic for habitual NetNews abusers - Beltway Annex
Distribution: na
Date: Wed, 19 Aug 92 03:16:13 GMT

How do I get a csh echo statement to output a newline?
All the book examples talk about supressing them. I want one!
--
A host is a host from coast to coast..wb8foz@skybridge.scl.cwru.edu
& no one will talk to a host that's close..........................
Unless the host (that isn't close).........................pob 1433
is busy, hung or dead....................................20915-1433
From: tchrist@convex.COM (Tom Christiansen)
Newsgroups: comp.unix.shell
Subject: Re: unwinding $variables in csh
Keywords: resolve, unwind $variables, csh
Date: 18 Aug 92 23:40:43 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Originator: tchrist@pixel.convex.com
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 roy@zooks.eng.mcmaster.ca (Roy Underhill):
:This looks like one of those times when cleverness does not pay off.

    "Never try to be too clever."  --me

Now, if only I'd stick to it better. :-)

--tom

-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist
    "...this does not mean that some of us should not want, in a rather
    dispassionate sort of way, to put a bullet through csh's head."
		Larry Wall in <1992Aug6.221512.5963@netlabs.com>
From: friedman@gnu.ai.mit.edu (Noah Friedman)
Newsgroups: comp.unix.shell
Subject: Re: How to make tcsh the login shell w/0 bothering operator? !FAQ
Date: 20 Aug 92 17:04:46 GMT
Article-I.D.: nutrimat.FRIEDMAN.92Aug20130446
Organization: Free Software Foundation, 675 Mass Ave. Cambridge, MA 02139

In article <Bsr2Jy.oD@news.cso.uiuc.edu> tinsel@uiuc.edu (Thomas Aaron Insel) writes:
> I built the tcsh myself and can have it run by typing "tcsh" in a csh
> (the login shell). Now, I want to make tcsh the default login shell,
> BUT do it without bothering the system operator. Trust me, I've done
> some homework, read the faq and fine-manual, but I can't find an
> answer.

   Just out of curiosity, why not get your sysadmin to put the appropriate
magic in /etc/shells?  It's what, 20 seconds of work?
From: friedman@gnu.ai.mit.edu (Noah Friedman)
Newsgroups: comp.unix.shell
Subject: Re: sending mail from shell
Date: 22 Aug 92 03:43:32 GMT
Organization: Free Software Foundation, 675 Mass Ave. Cambridge, MA 02139
In-reply-to: hendefd@woof.duc.auburn.edu's message of 21 Aug 92 15:41:05 GMT

In article <1992Aug21.154105.25371@news.duc.auburn.edu> hendefd@woof.duc.auburn.edu (Frank Henderson) writes:
>I need a shell script (csh or sh) to send me mail after completion.  I
>tried /usr/lib/sendmail -bm -fperson -t me and then echo'ing a message but
>this requires an EOF or CTRL-d which I don't know how to do from a shell.
>Could someone tell me how to do this or suggest a better way.

   If you have sendmail, I find that the following works fine in bourne
shell: 

           sendmail -t << __EOF__
           From: me
           To: you
        
           Frob me, baby. 

           __EOF__


If you don't have sendmail but have an SMTP port you can talk directly to,
I have a more complex example that works with bash.  I'll send it to
interested parties by email.
From: ddb0248@mcnews.mcdata.com (David Beal)
Newsgroups: comp.unix.shell
Subject: How to detect login shell in .cshrc ?
Date: 17 Aug 92 22:42:25 GMT
Organization: McDATA Corp.

Is there a clean way in your .cshrc to determine whether it is
being executed by the login shell?  I have some commands that I 
want to execute only if this is *not* the login shell.

The best I could come up with is to run "ps" and count the number
of lines it outputs after maybe grepping them for "csh".  Really ugly.

Please reply by email.  Thanks.

Dave Beal
McDATA Corporation
ddb@mcdata.com
Newsgroups: comp.unix.shell
From: jimh@pacdata.com (Jim Harkins)
Subject: sh menu system wanted
Organization: Pacific Data Products
Date: Tue, 18 Aug 1992 23:12:16 GMT

I need a simple menuing system written in the bourne shell, does anybody
know of one?  It just needs to present a list of options and let the
user choose y/n responses, then execute certain commands based on the
response.  It will run on a PC and I don't have time to get perl running,
it's gotta be bourne shell.

thanks.

jim

-- 
Lawyers Creed:  What's mine is mine, what's yours is negotiable.
--------------------------------------------------------------
Jim Harkins                         [ucsd|uunet]!pacdata!jim
Pacific Data Products               jim@pacdata.com
--------------------------------------------------------------
From: corrado@abyss.sni-usa.com (Corrado Giacomini)
Newsgroups: comp.unix.shell
Subject: How to return a job in foreground from shell script
Date: 12 Aug 92 14:16:29 GMT
Reply-To: corrado@abyss.sni-usa.com (Corrado Giacomini)
Organization: Siemens-Nixdorf Information Systems, Inc. Cambridge, MA

I need to write a script which has to put a job in background, 
susped the execution of the job,  continue the job execution in 
background, and finally quit it.
What i tryed is this:
pgm  &
/bin/ps -e | grep "pgm" | awk '{ print $1 }' | xargs kill -TSTP
/bin/ps -e | grep "pgm" | awk '{ print $1 }' | xargs kill -CONT
/bin/ps -e | grep "pgm" | awk '{ print $1 }' | xargs kill -QUIT  

but  what I got  is only a stopped job,  the QUIT signal then 
quit the job and produces a core ??
Is there a way for example to place for example the job in
foreground from shell script like using  fg command ?

-------------------------------------------------
Corrado Giacomini
email corrado@sni-usa.com
           giacomin@dnc1.ico.olivetti.com
-------------------------------------------------
From: stuart@wstuart (Stuart Hood)
Newsgroups: comp.unix.shell
Subject: Re: Sed with shell variables
Date: 21 Aug 92 11:07:19 GMT
Reply-To: stuart@siesoft.co.uk
Organization: Siemens Nixdorf Information Systems Ltd.
X-Newsreader: Tin 1.1 PL4

rgasch@nl.oracle.com (Robert Gasch) writes:
: Using sed to edit strings is usually a nice and practical
: method of doing so. I you want to change a pattern you usually
: say:
: 	echo $something|sed 's/pattern1/pattern2/'
: 
: The problem I ran into is that I can't get shell variables to
: work as arguments. When I type
: 	echo $something|sed 's/$this_pattern_var/$that_pattern_var/'
: 
: sed throws up on me. I've tried various combinations of quotation
: marks without success. Is there an easy way of doing this??
: 

echo "$something" | sed 's/'"$this_pattern_var"'/'"$that_pattern_var"'/'

The double quotes around the shell variables are only
needed if they contain any spaces (or tabs).

Stuart.
-
--
S I E M E N S  Stuart Hood === Siemens Nixdorf House, Bracknell, Berks, UK
-------------  Phone: + 44-344-850892          Email: stuart@siesoft.co.uk
N I X D O R F  - Never let ignorance stand in the way of a good argument -
From: aspin@up41 (David Aspinwall 7842)
Newsgroups: comp.unix.shell
Subject: Re: Password protection for terminal via shell.
Date: 13 Aug 92 23:00:23 GMT
Organization: LSI Logic Corporation
X-Newsreader: Tin 1.1 PL5


If you don't want to embed the password in the script,
and you can use perl, try doing something like this:


#!/usr/bin/perl
# lock terminal until user enters their password (or the root password)

&ignore();
system("stty -echo susp ^-");
while (!&check_passwd(1)) {
    print "\nbetter luck next time\n";
}
system("reset");



# ignore some signals
sub ignore {
    $SIG{'INT'} = 'IGNORE';
    $SIG{'QUIT'} = 'IGNORE';
    $SIG{'HUP'} = 'IGNORE';
    $SIG{'TERM'} = 'IGNORE';
}



# check_passwd : prompts user to enter a password, and checks it
#   if a non-zero is passed in, check vs the root password as well
#   use the first 2 chars of the encrypted password as salt for crypt
sub check_passwd {
    local ($allowroot) = @_;

    print "enter password: ";
    chop ($passwd = <>);

    ($name,$cryptpasswd) = getpwuid($<);
    return 1 if (crypt($passwd, substr($cryptpasswd, 0, 2)) eq $cryptpasswd);

    if ($allowroot) {
	($name,$cryptpasswd) = getpwuid(0);
	return 1 if (crypt($passwd, substr($cryptpasswd, 0, 2)) eq $cryptpasswd);
    }
    return 0;
}

		-- David Aspinwall	aspin@lsil.com	408-433-7842
From: boyd@prl.dec.com (Boyd Roberts)
Newsgroups: comp.unix.shell
Subject: Re: How can I rm a file with a '&' ????
Date: 23 Aug 92 16:25:22 GMT
Organization: Digital Equipment Corporation - Paris Research Laboratory

In article <kimcm.714581695@login.dkuug.dk>, kimcm@login.dkuug.dk (Kim Chr. Madsen) writes:
>  
> no, no , no
> 

And you thought ampersands were hard?  Just consider semi-colons:

   ; ; rm ';' ;


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
From: hymowitz@whatever.cs.jhu.edu (Hymie!)
Newsgroups: comp.unix.shell
Subject: Re: an ugly shell script that i'd like to fix
Date: 20 Aug 92 20:11:25 GMT
Organization: Creative Sensualities dept, Jacquie's House of Underwear

thanx for all the help.  the solution was to learn to write shells
in csh, and to use an alias:
alias prog "source prog \!*"
to pass an argv into the script.

--hymie
hymowitz@cs.jhu.edu                                         hymie@jhuvms.bitnet
-------------------------------------------------------------------------------
I'm just a soul whose intentions are good.
Oh, Lord, please don't let me be misunderstood.
--Nina Simone
--------------------------------------------------------------------------------
From: gwc@root.co.uk (Geoff Clare)
Newsgroups: comp.unix.shell
Subject: Re: How do I get .login to pause ?
Date: 17 Aug 92 13:24:40 GMT
Organization: UniSoft Ltd., London, England

In <22412@sybase.sybase.com> hsc@sybase.com (Howard Cohen) writes:

|In article <Bss2xD.GKE@root.co.uk> gwc@root.co.uk (Geoff Clare) writes:
|>In <1992Aug6.195643.4702@prl.dec.com> boyd@prl.dec.com (Boyd Roberts) writes:
|>
|>>Sigh.  line(1) is not portable, neither is `echo -n'.  Use:
|>
|>>    echo "Press RETURN to continue..." | tr -d '\012'
|>>    read x
|>
|>If it comes to that, '\012' is not portable either.  Use:

|What?!?  What Unix machines won't this work on?

Any machine that doesn't have ASCII as its native character set.
-- 
Geoff Clare <gwc@root.co.uk>  (USA UUCP-only mailers: ...!uunet!root.co.uk!gwc)
UniSoft Limited, London, England.   Tel: +44 71 729 3773   Fax: +44 71 729 3273
From: hsc@sybase.com (Howard Cohen)
Newsgroups: comp.unix.shell
Subject: Re: How do I get .login to pause ?
Date: 14 Aug 92 00:38:06 GMT
Organization: Sybase, Inc.

In article <Bss2xD.GKE@root.co.uk> gwc@root.co.uk (Geoff Clare) writes:
>In <1992Aug6.195643.4702@prl.dec.com> boyd@prl.dec.com (Boyd Roberts) writes:
>
>>Sigh.  line(1) is not portable, neither is `echo -n'.  Use:
>
>>    echo "Press RETURN to continue..." | tr -d '\012'
>>    read x
>
>If it comes to that, '\012' is not portable either.  Use:

What?!?  What Unix machines won't this work on?  I have a hard time believing
that this isn't portable, but I do agree its ugly.

Still, I must admit, I like your other two suggestions (quoting a newline, and
an autodetect for the echo argument. Both are clever.

	Howard
-------------------------------------------------------------------------------
  Howard "I wood if I could" Cohen
  hsc@sybase.com  {pacbell,pyramid,sun,{uunet,ucbvax}!mtxinu}!sybase!hsc
  Sybase, Inc.    6475 Christie Avenue, Emeryville, CA 94608, 510-596-3406 
Newsgroups: comp.unix.shell
From: stilley@csr.uucp (Scott  Tilley)
Subject: Re: unwinding $variables in csh
Keywords: resolve, unwind $variables, csh
Organization: University of Victoria, Victoria, BC, Canada
Date: Thu, 13 Aug 92 18:02:23 GMT


Well, using eval will work, but only for one layer of unwinding, if you
will. The solution I came up with is:

  while ( $var =~ *\$* )
    set var = `eval echo $var`
  end

This just keeps looping as long as it finds a '$' in the current "val",
and if so, eval's it. Messy, but works for me.

	..Scott
From: hsc@sybase.com (Howard Cohen)
Newsgroups: comp.unix.shell
Subject: Re: Octal chmod status
Date: 14 Aug 92 00:30:18 GMT
Organization: Sybase, Inc.

In article <MERLYN.92Aug9093023@romulus.reed.edu> merlyn@romulus.reed.edu (Randal L. Schwartz) writes:
>In article <17205.2219215579@kcbbs.gen.nz> Rowan_Smith@kcbbs.gen.nz (Rowan Smith) writes:
>   Can somebody please give me a command/method by which I can get the 
>   octal equivilant of rwxrwxr-x etc so that I can do the following.
>
>   set perm = 'octalconv <filename>'
>
>   is ($perm != 0511) then
>      etc....

Well, here's a brute force method I've used successfully.  This can
certainly be done in a smarter way, and it could also be made to understand
things like the sticky bit, the setuid bit, the setgid bit, etc.  I didn't
need that stuff though because I knew the files were source code.

------------------------- cut here --------------------------------------

#!/bin/sh

LSPERMS=`ls -l "$1" | sed -e "s:^\([^  ][^     ]*\).*:\1:"`
USR=`echo $LSPERMS X| sed -e "s:.\(...\).*:\1:"`
GRP=`echo $LSPERMS X| sed -e "s:....\(...\).*:\1:"`
OTH=`echo $LSPERMS X| sed -e "s:.......\(...\).*:\1:"`

PERMS=""
for elem in $USR $GRP $OTH
do
     case "$elem" in
	 ---)    PERMS="${PERMS}0";;
	 --x)    PERMS="${PERMS}1";;
	 -w-)    PERMS="${PERMS}2";;
	 -wx)    PERMS="${PERMS}3";;
	 r--)    PERMS="${PERMS}4";;
	 r-x)    PERMS="${PERMS}5";;
	 rw-)    PERMS="${PERMS}6";;
	 rwx)    PERMS="${PERMS}7";;
     esac
done

echo $PERMS

------------------------- cut here --------------------------------------

	Howard
-------------------------------------------------------------------------------
  Howard "I wood if I could" Cohen
  hsc@sybase.com  {pacbell,pyramid,sun,{uunet,ucbvax}!mtxinu}!sybase!hsc
  Sybase, Inc.    6475 Christie Avenue, Emeryville, CA 94608, 510-596-3406 
Newsgroups: comp.unix.shell
From: navarra@casbah.acns.nwu.edu (John Navarra)
Subject: Re: searching for 1st occurrence
Organization: Northwestern University, Evanston Illinois.
Date: Mon, 17 Aug 1992 00:15:16 GMT

In article <MITCH.92Aug16153742@mira.clsi> mitch@clsi (Mitchell N. Perilstein) writes:
>
>You can just skip the grep and do it in one step:
>
>    awk '/SS2/ {print; exit}' < systems
>

or, you can just skip awk and do it in sed:

    sed -n '/123/{p;q;}' filename

-tms


-- 
From the Lab of the MaD ScIenTiST:
					
navarra@casbah.acns.nwu.edu