tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Killing a background process in Bourne shell...

Seasoned users ▻

I'm having problems

In article <390DD1CD.BFA89ACD@lineone.net>,
steven_314  <steven_314@lineone.net> wrote:
>Hello, I want to select lines  in file_2 using id numbers from file_1.
>In file-2 feilds are separated by a single tab. I've tried what I know,
>which isn't much.

Sounds easy enough.  Try this, where `<tab>' is a literal tab character.

    for i in `cat file_1`; do
            grep "^$i<tab>" file_2
    done

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: I'm having problems
Date: 8 May 2000 13:39:15 +0100
Message-ID: <8f6ci9$l0l$1@ltpcg.star.le.ac.uk>
References: <390DD1CD.BFA89ACD@lineone.net>

△ comp.unix.shell △

◅ Killing a background process in Bourne shell...

Seasoned users ▻