tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ mounted file systems and permissions

tab in regular expresion ▻

a cshell problem: putting grep output into variable

In article <375D1EBD.8D7AFCBD@netvision.net.il>,
Guy & Gad Berg  <gberg@netvision.net.il> wrote:
>set line='grep 'abcd' myfile'

You need to use backquotes,which are unfortunately somtimes difficult to
distinguish from normal quotes.

    set line = `grep abcd myfile`

(In this example, you don't need to quote grep's first argument.  Of
course, you would if it contained spaces, or other characters special to
the shell.)

Tim.
--
Tim Goodwin   | `I can't believe that someone is releasing
University of | something called "Unix" without something
Leicester, UK | called "/bin/sh".' -- Randal L. Schwartz

Original headers:

From: tjg@ltpcg.star.le.ac.uk (Tim J Goodwin)
Newsgroups: comp.unix.shell,comp.unix.questions
Subject: Re: a cshell problem: putting grep output into variable
Date: 10 Jun 1999 11:04:28 +0100
Organization: University of Leicester, UK
Message-ID: <7jo2jc$9p$1@ltpcg.star.le.ac.uk>
References: <375D1EBD.8D7AFCBD@netvision.net.il>

△ comp.unix.shell △

◅ mounted file systems and permissions

tab in regular expresion ▻