HP3000-L Archives

January 2007, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Donna Hofmeister <[log in to unmask]>
Reply To:
Date:
Sat, 27 Jan 2007 14:35:10 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (123 lines)
despite what the shell leads you to believe...grep will only process *one file at a time*.  in the shell, when you pass ./foo* to grep, it's actually the shell that's creating the loop for you.

what does work for mpe is this:
           :grep.hpbin.sys "'!search_string'" < !_g_file_name
where (of course) the variables search_string and _g_file_name have something in them and (most importantly) _g_file_name is a single file.  _g_file_name does *not* have to be expressed in hfs format because grep is being run from the ci (rather than the shell).

to create the same illusion of having grep search thru [log in to unmask], you need to do one of two things...

1. run sh.hpbin.sys "-c 'grep....'" (as someone has already suggested)   --or--
2, write a script (which you'd probably do for option 1 anyhow...) but in this case, the script is going to do a few other nice things for you.

grep (being the village savant that it is) can search regular files just fine....but don't try to hand it something like a 'msg' or binary file -- it will muddify it's little mind! :-)

the script i use (y'all *knew this was coming, yes? :-) has all sorts of checks in it so you can say pass something like @.source, and it will gracefully skip files that grep can't handle.

if you'd like a copy, please let me know.              - d

---- 
Donna Hofmeister, HP-CSA Sr. System Programmer
dgarverick -at- longs -dot- com
925-210-6631 Longs Drug Stores

>>>MY opinions, not Longs Drug Stores'<<<


----- Original Message ----
From: Ray Shahan <[log in to unmask]>
To: [log in to unmask]
Sent: Friday, January 26, 2007 1:03:29 PM
Subject: [HP3000-L] Got 'dem ole POXIS blues again, mamma


Hi all,



            I'm trying to write a little script to do some searches on
ASCII files.  I can get the script to work with a direct file name, but
not with wildcarding...am I doing something wrong, or just SOL?





This does not work:

:xeq grep.hpbin.sys '-lin "COMMERCIAL;" /PTC/ASCII/*'

GREP.HPBIN.SYS: input file "/PTC/ASCII/*": No such file or directory







This doesn't work either:

:xeq grep.hpbin.sys '-lin "COMMERCIAL;" /PTC/ASCII/@'

GREP.HPBIN.SYS: input file "/PTC/ASCII/@": No such file or directory







But this does:

:xeq grep.hpbin.sys '-lin "COMMERCIAL;" /PTC/ASCII/CPROG'

/PTC/ASCII/CPROG







TIA!



  <http://www.republictitle.com/> 

Raymond Shahan

Computer Programmer
REPUBLIC TITLE OF TEXAS, INC. <http://www.republictitle.com/> 
  2701 W Plano Parkway
<http://maps.yahoo.com/maps_result?addr=2701+w+plano+parkway&csz=75075&c
ountry=us&new=1&name=&qty=>  
Plano, TX 75075




direct 214.556.0202
main 972.578.8611
fax 972.424.5621

www.republictitle.com <http://www.republictitle.com/> 

[log in to unmask]






* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *


 
____________________________________________________________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2