home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!stanford.edu!nntp.Stanford.EDU!dkeisen
- From: dkeisen@leland.Stanford.EDU (Dave Eisen)
- Subject: Re: Extracting regular expressions using egrep/
- Message-ID: <1993Jan5.202010.8287@leland.Stanford.EDU>
- Sender: ?@leland.Stanford.EDU
- Organization: Sequoia Peripherals, Inc.
- References: <1993Jan5.135145.28405@infolog.se> <1993Jan5.195647.19715@crd.ge.com>
- Date: Tue, 5 Jan 93 20:20:10 GMT
- Lines: 21
-
- In article <1993Jan5.195647.19715@crd.ge.com> csdgwh@sn370.utica.ge.com (Glenn W. Hoffman) writes:
-
- >works silently, i.e., returns only a status that you may test in the
- >if command. I am not a csh programmer, but it appears that you could say
- > if (echo $var | egrep -s '<regexp>') then ...
-
- No. The csh is looking for a boolean expression inside the
- parentheses; it is not looking for the exit status of a
- program like /bin/sh would do in the analogous situation.
-
- This construct is usually written:
-
- echo $var | egrep -s '<regexp>'
- if ( $status == 0 ) then ...
-
-
- --
- Dave Eisen Sequoia Peripherals: (415) 967-5644
- dkeisen@leland.Stanford.EDU Home: (415) 321-5154
- There's something in my library to offend everybody.
- --- Washington Coalition Against Censorship
-