Got 'dem ole POXIS blues again, mamma

Got 'dem ole POXIS blues again, mamma

Post by Ray Shaha » Sun, 28 Jan 2007 06:03:29


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.yqcomputer.com/ ;

Raymond Shahan

Computer Programmer
REPUBLIC TITLE OF TEXAS, INC. < http://www.yqcomputer.com/ ;
2701 W Plano Parkway
< http://www.yqcomputer.com/ +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.yqcomputer.com/ ;

XXXX@XXXXX.COM






* To join/leave the list, search archives, change list settings, *
* etc., please visit http://www.yqcomputer.com/ *
 
 
 

Got 'dem ole POXIS blues again, mamma

Post by rt » Sun, 28 Jan 2007 07:24:57

Well, I've got one strike today.
I'll try another swing.....



Things to remember:
In posix, the shell does filename expansion for wildcards, ie:
grep pattern *
the shell makes it: grep pattern file1 file2 file2 ....


In MPE, the CI does not expand wildcards. So what you pass is what gets sent.
MPE programs that allow wildcards, have the code in them to expand filesets.

You might try
:xeq sh.hpbin.sys '-c "grep -lin ""COMMERCIAL;"" /PTC/ASCII/*"'


Keven

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://www.yqcomputer.com/ *

 
 
 

Got 'dem ole POXIS blues again, mamma

Post by Donna Hofm » Mon, 29 Jan 2007 07:35:10

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 foo@.jcl.acct, 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



----- Original Message ----
From: Ray Shahan < XXXX@XXXXX.COM >
To: XXXX@XXXXX.COM
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.yqcomputer.com/ ;

Raymond Shahan

Computer Programmer
REPUBLIC TITLE OF TEXAS, INC. < http://www.yqcomputer.com/ ;
2701 W Plano Parkway
< http://www.yqcomputer.com/ +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.yqcomputer.com/ ;

XXXX@XXXXX.COM






* To join/leave the list, search archives, change list settings, *
* etc., please visit http://www.yqcomputer.com/ *



____________________________________________________________________________________
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://www.yqcomputer.com/ *
 
 
 

Got 'dem ole POXIS blues again, mamma

Post by Ray Shaha » Tue, 30 Jan 2007 23:33:39

Thanks, that did the trick!


Raymond Shahan
Computer Programmer
REPUBLIC TITLE OF TEXAS, INC.
2701 W Plano Parkway
Plano, TX 75075


direct 214.556.0202
main 972.578.8611
fax 972.424.5621
www.republictitle.com
XXXX@XXXXX.COM

-----Original Message-----
From: Keven Miller (rtt) [mailto: XXXX@XXXXX.COM ]
Sent: Friday, January 26, 2007 4:25 PM
To: Ray Shahan
Cc: XXXX@XXXXX.COM
Subject: Re: [HP3000-L] Got 'dem ole POXIS blues again, mamma

Well, I've got one strike today.
I'll try another swing.....



Things to remember:
In posix, the shell does filename expansion for wildcards, ie:
grep pattern *
the shell makes it: grep pattern file1 file2 file2 ....


In MPE, the CI does not expand wildcards. So what you pass is what gets
sent.
MPE programs that allow wildcards, have the code in them to expand
filesets.

You might try
:xeq sh.hpbin.sys '-c "grep -lin ""COMMERCIAL;"" /PTC/ASCII/*"'


Keven

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://www.yqcomputer.com/ *
 
 
 

Got 'dem ole POXIS blues again, mamma

Post by Ray Shaha » Tue, 30 Jan 2007 23:47:15

purposely used ASCII file because I'd previously learned (the hard
way, of course) that grep doesn't like binary files (and hey, who
does?).

Anyway, yes, donna, I'd like a copy of your script...thanks for the
offer.

One really big problem I have with POSIX and/or CMD files is not so much
POSIX or CMD files, but frequency of use. I create CMD files and POSIX
stuff so rarely, that every time I do, I have to start all over with
learning the stuff (high school in the early 70's + creeping age = lousy
memory ;-)

Have a great week.


Raymond Shahan
Computer Programmer
REPUBLIC TITLE OF TEXAS, INC.
2701 W Plano Parkway
Plano, TX 75075


direct 214.556.0202
main 972.578.8611
fax 972.424.5621
www.republictitle.com
XXXX@XXXXX.COM


-----Original Message-----
From: XXXX@XXXXX.COM [mailto: XXXX@XXXXX.COM ]
Sent: Saturday, January 27, 2007 4:35 PM
To: Ray Shahan; XXXX@XXXXX.COM
Subject: Re: [HP3000-L] Got 'dem ole POXIS blues again, mamma

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 foo@.jcl.acct,
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



----- Original Message ----
From: Ray Shahan < XXXX@XXXXX.COM >
To: XXXX@XXXXX.COM
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.republic