|
|
|
|
|
|
| Author |
Message |
Slo *nix forums beginner
Joined: 10 Feb 2005
Posts: 1
|
Posted: Thu Feb 10, 2005 12:47 pm Post subject:
Re: grep on openVMS?
|
|
|
Indeed. There is also a striking similarity (for this particular
command, of course) -- two pipes vs two switches:
| grep tcpip | grep hib
/pr=tcp* /st=h*
So, in a sense, DCL already implements specific "greps"
in many commands:
DIR/SINCE, DIR/SIZE, TYPE/BY_OWNER
But unlike a unix grep that scans the output, DCL switches
work on a particular attribute/object. It's more precise,
when you need it. Thus, a SHOW SYSTEM line:
00000226 TCPIP$HIBOB LEF 10 123 0 00:00:00.23 148 667
would be wrongly displayed by a grep approach, but ignored
with /STATE=HIB. |
|
| Back to top |
|
 |
Michael Clark *nix forums beginner
Joined: 07 Apr 2005
Posts: 12
|
Posted: Thu Feb 10, 2005 4:14 pm Post subject:
RE: grep on openVMS?
|
|
|
| Quote: | "Z" <Z@no.spam> wrote in message
news:BlzOd.42762$365.21827@fe07.lga...
bob@instantwhip.com wrote:
?
$ SEARCH
OpenVMS uses English ... unix uses words that
first graders don't even understand ...
*NIX grep understands regular expressions, making it
much more useful than $SEARCH. I usually end up in
Perl on VMS to get access to regular expressions.
All,
As to the OP's query, I suspect he only wanted to know the name of the
OpenVMS 'file content search facility', thus I would be
inclined to believe
that responding with SEARCH is the most appropriate answer for these
reasons:
|
Thank you Anthony =) I am reading the help for this command and it
seems to me that I can only use this if the information I want is
contained in a file unless sys$input is declared?
I made a grep symbol as someone else suggested so Ill have less
problems remembering
ALPHA1::[MICCLA]>show symbol grep
GREP == "SEARCH SYS$INPUT"
show device dkb1/files/nosys | grep 00004c6c did nothing for me.
So I ended up doing
show device dkb1/files/nosys/out=ps.pid
So, what am I doing wrong? =(
CONFIDENTIALITY NOTE: This electronic transmission, including all
attachments, is directed in confidence solely to the person(s) to whom it is
addressed, or an authorized recipient, and may not otherwise be distributed,
copied or disclosed. The contents of the transmission may also be subject to
intellectual property rights and all such rights are expressly claimed and
are not waived. If you have received this transmission in error, please
notify the sender immediately by return electronic transmission and then
immediately delete this transmission, including all attachments, without
copying, distributing or disclosing same. |
|
| Back to top |
|
 |
Wilm Boerhout *nix forums addict
Joined: 10 Feb 2005
Posts: 74
|
Posted: Thu Feb 10, 2005 4:29 pm Post subject:
Re: grep on openVMS?
|
|
|
Try
$ pipe show devi dkb1:/files /nosys | search sys$pipe myfile
| Quote: |
ALPHA1::[MICCLA]>show symbol grep
GREP == "SEARCH SYS$INPUT"
show device dkb1/files/nosys | grep 00004c6c did nothing for me.
So I ended up doing
show device dkb1/files/nosys/out=ps.pid
So, what am I doing wrong? =(
|
--
Wilm Boerhout
Zwolle, The Netherlands
wilmOLD@PAINTboerhout.nl
(remove OLD PAINT from this address before use) |
|
| Back to top |
|
 |
Michael Clark *nix forums beginner
Joined: 07 Apr 2005
Posts: 12
|
Posted: Thu Feb 10, 2005 4:53 pm Post subject:
RE: grep on openVMS?
|
|
|
| Quote: | -----Original Message-----
From: Wilm Boerhout [mailto:wOLD.boerhout@PAINTplanet.nl]
Sent: Thursday, February 10, 2005 11:30 AM
To: Info-VAX@Mvb.Saic.Com
Subject: Re: grep on openVMS?
Try
$ pipe show devi dkb1:/files /nosys | search sys$pipe myfile
|
Great! Thank you!
| Quote: |
ALPHA1::[MICCLA]>show symbol grep
GREP == "SEARCH SYS$INPUT"
show device dkb1/files/nosys | grep 00004c6c did nothing for me.
So I ended up doing
show device dkb1/files/nosys/out=ps.pid
So, what am I doing wrong? =(
--
Wilm Boerhout
Zwolle, The Netherlands
wilmOLD@PAINTboerhout.nl
(remove OLD PAINT from this address before use)
|
CONFIDENTIALITY NOTE: This electronic transmission, including all
attachments, is directed in confidence solely to the person(s) to whom it is
addressed, or an authorized recipient, and may not otherwise be distributed,
copied or disclosed. The contents of the transmission may also be subject to
intellectual property rights and all such rights are expressly claimed and
are not waived. If you have received this transmission in error, please
notify the sender immediately by return electronic transmission and then
immediately delete this transmission, including all attachments, without
copying, distributing or disclosing same. |
|
| Back to top |
|
 |
Z *nix forums Guru Wannabe
Joined: 28 Jul 2005
Posts: 163
|
Posted: Thu Feb 10, 2005 7:16 pm Post subject:
Re: grep on openVMS?
|
|
|
bob@instantwhip.com wrote:
| Quote: | for first time users it is not the way your brain works! I can
sit a new user or programmer down at vms and with little instruction
and the help facilities he is productive the first day ... in
unix land it is the opposite and is COUNTERPRODUCTIVE!
|
I don't know why.
You can use grep with standard expresions, just like $SEARCH.
Regular expression get you so much more ... Start of Line, End of Line,
user-defined patterns and ranges, etc.
I suspect that if $SEARCH had regular expressions, a lot of posters here
would be touting that as a powerful feature (which it is), rather than
dismissing it. |
|
| Back to top |
|
 |
Slo *nix forums beginner
Joined: 11 Feb 2005
Posts: 1
|
Posted: Fri Feb 11, 2005 8:06 am Post subject:
Re: grep on openVMS?
|
|
|
Your example works here fine:
J9>show system/noproc
OpenVMS V7.3-2 on node ZTREE 11-FEB-2005 08:53:44.45 Uptime 2
23:14:39
J9>SHOW SYMBOL GREP
GREP == "SEARCH SYS$INPUT"
J9>pipe SHOW DEVICE DKB100/FILES/NOSYSTEM | grep 00000239
Httpd 00000239 [PURVEYOR]PURVEYOR_CONTROLLER.COM;2
Httpd 00000239 [PURVEYOR]CONTROLLER_AXP.EXE;2
Httpd 00000239 [USER.HTTPD]HS050211.LOG;1
J9>pipe SHOW DEVICE DKB100/FILES/NOSYSTEM | grep PURV
Httpd 00000239 [PURVEYOR]PURVEYOR_CONTROLLER.COM;2
Httpd 00000239 [PURVEYOR]CONTROLLER_AXP.EXE;2
Httpd 0001 0000024D [USER.HTTPD]PURVEYOR_WORKER.LOG;553
Httpd 0001 0000024D [PURVEYOR]PURVEYOR_WORKER.COM;2
I don't know why I chose SYS$INPUT over SYS$PIPE, but
it's been years I've used it without surprises. However,
there must subtle differences somewhere...
You'll find both uses in:
J9>sea sys$manager:*.com sea,sys$pipe
J9>sea sys$manager:*.com sea,sys$input |
|
| Back to top |
|
 |
Slo *nix forums beginner
Joined: 11 Feb 2005
Posts: 1
|
Posted: Fri Feb 11, 2005 8:09 am Post subject:
Re: grep on openVMS?
|
|
|
| Quote: | show device dkb1/files/nosys | grep 00004c6c did nothing for me.
|
Could the cause be that you forgot to put "pipe" in front of this
command?
But then, you should have seen an error... |
|
| Back to top |
|
 |
Z *nix forums Guru Wannabe
Joined: 28 Jul 2005
Posts: 163
|
Posted: Sat Feb 12, 2005 8:15 am Post subject:
Re: grep on openVMS?
|
|
|
Slo wrote:
| Quote: | I don't know why I chose SYS$INPUT over SYS$PIPE, but
it's been years I've used it without surprises. However,
there must subtle differences somewhere...
|
Use SYS$INPUT if PIPE is interactive.
Use SYS$PIPE if PIPE is in a DCL program. |
|
| Back to top |
|
 |
Phillip Helbig---remove C *nix forums Guru
Joined: 07 Jul 2005
Posts: 576
|
Posted: Sat Feb 12, 2005 10:27 am Post subject:
Re: grep on openVMS?
|
|
|
In article <eUjPd.60462$Fp7.36684@fe07.lga>, Z <Z@no.spam> writes:
| Quote: | Slo wrote:
I don't know why I chose SYS$INPUT over SYS$PIPE, but
it's been years I've used it without surprises. However,
there must subtle differences somewhere...
Use SYS$INPUT if PIPE is interactive.
Use SYS$PIPE if PIPE is in a DCL program.
|
Is there a reason NOT to use SYS$PIPE interactively? |
|
| Back to top |
|
 |
Craig A. Berry *nix forums Guru Wannabe
Joined: 27 May 2005
Posts: 143
|
Posted: Sat Feb 12, 2005 3:35 pm Post subject:
regular expression support on OpenVMS (was Re: grep on openVMS?)
|
|
|
In article <FjJOd.155241$K7.61630@news-server.bigpond.net.au>,
"Anthony Borla" <ajborla@bigpond.com> wrote:
| Quote: | * Implement regular expression code as LIB$ routine(s),
say LIB$REGEX and LIB$REGEX_END, that are
modelled on the LIB$FIND_FILE and the
LIB$FIND_FILE_END routines
|
Wildcard matching of filenames is only one example of regular
expression matching. Your proposed names conflate the example with the
thing it is an example of. For filename matching, it would be better
to just use another bit of the flags argument to LIB$FIND_FILE and call
it, say, LIB$M_FIL_REGEX.
The need for a bundled API that supports regular expression matching is
a separate need from a regex filename matching capability, though the
latter would almost certainly be built upon the former. There are
already standard APIs. See documentation for the POSIX regular
expression API here:
http://www.opengroup.org/onlinepubs/7990989775/xsh/regcomp.html
There is a Perl-compatible regular expression (PCRE) library here:
http://www.pcre.org/
PCRE supports the POSIX API as well as having its own, more Perl-like
regex API and is free, even for commercial use. It's used by Python
and a lot of other open source packages.
| Quote: | * Implement new lexical function(s), say, F$REGEX,
and F$REGEX_END that use the new LIB$ routines,
thus supplying regular expression support at the DCL
level
|
Again, regex pattern matching is not necessarily just an alternate
filename wildcard method. An alternate way of expressing wildcards to
F$SEARCH would be a different enhancement from adding a lexical that
would match patterns in any string.
| Quote: | The benefit of a new SEARCH qualifier is that it allows the user to choose
whether regular expressions will be, or not be, used. And, whether used or
not, the command would behave exactly as it does now in terms of the output
produced, so maintaining backwards compatibility.
|
Instead of /REGEX, it might be better to make it
/WILDCARD=TRADITIONAL (D)
/WILDCARD=REGEX
Or, if you prefer, PATTERN instead of WILDCARD. As far as I can see,
there is currently in SEARCH no capability for matching file contents
against patterns of any kind, even traditional VMS wildcards.
| Quote: | And, of course, the benefit of implementing regular expression support at
the LIB$ level is that of high performance and standardisation: it becomes a
core OpenVMS feature, not a 'tack on'.
|
Agreed. Adding POSIX regular expression support to the CRTL would be a
place to start. Building a LIB$ interface around that for folks using
languages other than C would be an added benefit (but it should
probably be STR$MATCH_REGEX rather than in the LIB$ space). Support
for pattern matching in SEARCH and via a DCL lexical would be nice to
have, and regular expressions should certainly be at least one of the
pattern matching types offered. |
|
| Back to top |
|
 |
David J Dachtera *nix forums Guru
Joined: 26 Jun 2005
Posts: 1067
|
Posted: Sat Feb 12, 2005 4:59 pm Post subject:
Re: grep on openVMS?
|
|
|
Z wrote:
| Quote: |
bob@instantwhip.com wrote:
for first time users it is not the way your brain works! I can
sit a new user or programmer down at vms and with little instruction
and the help facilities he is productive the first day ... in
unix land it is the opposite and is COUNTERPRODUCTIVE!
I don't know why.
|
Have you (or anyone you know) ever been "grep"-ed by a law-enforcement
agent? ...ever been served with or even heard of a "grep" warrant?
....ever heard of an internet "grep" engine? ...ever heard of a "grep"
and rescue mission?
'Nuff said.
| Quote: | You can use grep with standard expresions, just like $SEARCH.
Regular expression get you so much more ... Start of Line, End of Line,
user-defined patterns and ranges, etc.
I suspect that if $SEARCH had regular expressions, a lot of posters here
would be touting that as a powerful feature (which it is), rather than
dismissing it.
|
Who is dismissing regular expressions? These would make a fine addition
to SEARCH.
--
David J Dachtera
dba DJE Systems
http://www.djesys.com/
Unofficial OpenVMS Hobbyist Support Page:
http://www.djesys.com/vms/support/
Unofficial Affordable OpenVMS Home Page:
http://www.djesys.com/vms/soho/
Unofficial OpenVMS-IA32 Home Page:
http://www.djesys.com/vms/ia32/
Coming soon:
Unofficial OpenVMS Marketing Home Page |
|
| Back to top |
|
 |
Anthony Borla *nix forums beginner
Joined: 21 Feb 2005
Posts: 18
|
Posted: Sat Feb 12, 2005 10:37 pm Post subject:
Re: regular expression support on OpenVMS (was Re: grep on openVMS?)
|
|
|
"Craig A. Berry" <craigberry@mac.com.spamfooler> wrote in message
news:craigberry-A23559.10351812022005@news.isp.giganews.com...
| Quote: | In article <FjJOd.155241$K7.61630@news-server.bigpond.net.au>,
"Anthony Borla" <ajborla@bigpond.com> wrote:
* Implement regular expression code as LIB$ routine(s),
say LIB$REGEX and LIB$REGEX_END, that are
modelled on the LIB$FIND_FILE and the
LIB$FIND_FILE_END routines
Wildcard matching of filenames is only one example of regular
expression matching. Your proposed names conflate the example
with the thing it is an example of. For filename matching, it would
be better to just use another bit of the flags argument to
LIB$FIND_FILE and call it, say, LIB$M_FIL_REGEX.
|
After posting I realised that such functionaility would probably be more
appropriately packaged as STR$ routines. Also, I'd intended regular
expression functionaily to be generally available, not simply used for file
searching; the LIB$FILE... examples were suggested as a possible way of
packaging regular expression functionality.
| Quote: |
The need for a bundled API that supports regular expression
matching is a separate need from a regex filename matching
capability, though the latter would almost certainly be built
upon the former. There are already standard APIs. See
documentation for the POSIX regular expression API here:
http://www.opengroup.org/onlinepubs/7990989775/xsh/regcomp.html
There is a Perl-compatible regular expression (PCRE) library here:
http://www.pcre.org/
PCRE supports the POSIX API as well as having its own,
more Perl-like regex API and is free, even for commercial use.
It's used by Python and a lot of other open source packages.
|
Yes, I'm familiar with it. However, it's still a third party package, not
part of the 'core' operating system libraries. Making it so, whether by
using / adapting existing libraries, or rewriting such code from scratch
[not something I'm advocating, merely outlining as another possible
approach] will add legitimacy to this functionality, thus future OpenVMS
application developers will probably not think twice about tapping into it.
| Quote: |
* Implement new lexical function(s), say, F$REGEX,
and F$REGEX_END that use the new LIB$ routines,
thus supplying regular expression support at the DCL
level
Again, regex pattern matching is not necessarily just an alternate
filename wildcard method. An alternate way of expressing
wildcards to F$SEARCH would be a different enhancement
from adding a lexical that would match patterns in any string.
|
Sure. My suggestions were intended to ensure that regular expression
functionality is implemented so as to ensure it is available at *all*
levels:
* BASIC, C, Fortran et al developers call on regular
expression functionality [thus, no need to decide whether
to use third party packages as the functionality is there]
* Lexical function(s) additions / modifications would
benefit DCL command procedure writers / end-users
* DCL-level commands like SEARCH that were
'regex-enhanced' would benefit end-users
In short, implement the facility so it is a natural extension of the OpenVMS
operating system. The concept / facility itself may not have originated on
OpenVMS, but it is *so* useful that it would be irresponsible to not use it,
either by pretending it isn't there [i.e. laughed off as simply another
*UNIXism], or by leaving it to individual sites to add this functionality
via third party libraries [e.g. PCRE] or utilities packages [e.g. GNV],
something which each site can still do [but may not, then, have to].
| Quote: |
The benefit of a new SEARCH qualifier is that it allows the
user to choose whether regular expressions will be, or not
be, used. And, whether used or not, the command would
behave exactly as it does now in terms of the output
produced, so maintaining backwards compatibility.
Instead of /REGEX, it might be better to make it
/WILDCARD=TRADITIONAL (D)
/WILDCARD=REGEX
|
Yes, I agree - much, much better !
| Quote: |
Or, if you prefer, PATTERN instead of WILDCARD. As far
as I can see, there is currently in SEARCH no capability for
matching file contents against patterns of any kind, even
traditional VMS wildcards.
|
No there isn't [as far as I can tell]; the closest you get to this type of
'matching power' is the facility for conditionally matching strings via the
/MATCH qualifier. However, I'm fairly sure, even it is not pattern-based.
Again, this would certainly be an improvement on my original suggestion.
| Quote: | And, of course, the benefit of implementing regular expression
support at the LIB$ level is that of high performance and
standardisation: it becomes a core OpenVMS feature, not a
'tack on'.
Agreed. Adding POSIX regular expression support to the
CRTL would be a place to start. Building a LIB$ interface
around that for folks using languages other than C would be
an added benefit (but it should probably be
STR$MATCH_REGEX rather than in the LIB$ space).
|
Sure.
| Quote: |
Support for pattern matching in SEARCH and via a DCL
lexical would be nice to have, and regular expressions should
certainly be at least one of the pattern matching types offered.
|
Yes, I believe it would definitely enhance the user experience [at all
levels: end-user, system adminstrator, application developer] which is,
after all, the prime aim of implementing such enhancements. Users then have
one less reason for, perhaps, wanting to use another operating system ? It
would also put OpenVMS on par with it's competitiors which all natively
support regular expressions in one way or another.
For those who would criticise this as an attempt to 'unixify' OpenVMS, my
response is that
OpenVMS doesn't have to become *NIX in order to better meet user needs,
merely borrow, adapt, or enhance ideas / facilities which are widely seen as
being useful. It's not as if it's without precedent [e.g. PIPE command,
changes in file naming in ODS-5]. And, after all, it's also only fair: how
may OpenVMS ideas / facilities have been 'borrowed' by *NIX - resource
quotas, journaling file system - to name but two ?
A ground-level effort to integrate regular expression support into OpenVMS
also has the advantage of ensuring this proceeds in a systematic - even
synergistic - manner. Existing tools become more useful, downwards
compatility is maintained, and the need for users requiring such
functionailty to become 'grepniks' and 'Perlisters' greatly diminishes.
Importantly, an OpenVMS idiom, that of easy to use, English-like command
usage, is protected.
Let's hope something positive follows on from these discussions !
Cheers,
Anthony Borla |
|
| Back to top |
|
 |
Z *nix forums Guru Wannabe
Joined: 28 Jul 2005
Posts: 163
|
Posted: Sun Feb 13, 2005 3:27 am Post subject:
Re: grep on openVMS?
|
|
|
David J Dachtera wrote:
| Quote: | Have you (or anyone you know) ever been "grep"-ed by a law-enforcement
agent? ...ever been served with or even heard of a "grep" warrant?
...ever heard of an internet "grep" engine? ...ever heard of a "grep"
and rescue mission?
'Nuff said.
|
Is your point that the name "grep" isn't intuitive?
The same is true for plenty of VMS commands, qualifiers and also layered
product commands. You just don't see it that way because of decades of
VMS exposure. |
|
| Back to top |
|
 |
Dave Froble *nix forums Guru
Joined: 21 Jul 2005
Posts: 1172
|
Posted: Sun Feb 13, 2005 7:23 am Post subject:
Re: grep on openVMS?
|
|
|
Z wrote:
| Quote: | David J Dachtera wrote:
Have you (or anyone you know) ever been "grep"-ed by a law-enforcement
agent? ...ever been served with or even heard of a "grep" warrant?
...ever heard of an internet "grep" engine? ...ever heard of a "grep"
and rescue mission?
'Nuff said.
Is your point that the name "grep" isn't intuitive?
The same is true for plenty of VMS commands, qualifiers and also layered
product commands. You just don't see it that way because of decades of
VMS exposure.
|
Actually, I think his point is that when you want to search, you use the
search command, not something that isn't part of the english language,
as far as I know. When you want a list of files, you use the somewhat
ambiguous DIRECTORY command. If LIST had been used, it would still be
english, but ls is a bit of a puzzle. The comparisons are many, and I'm
not sure that the Unix commands would come out favorable in any comparison.
Do you have a list of VMS commands and qualifiers that you feel are
ambiguous? I'm interested in seeing such.
I've never used MAN, but I've read many unfavorable comparisons with the
VMS HELP command.
Dave |
|
| Back to top |
|
 |
bob@instantwhip.com *nix forums Guru
Joined: 23 Jul 2005
Posts: 384
|
Posted: Sun Feb 13, 2005 1:03 pm Post subject:
Re: grep on openVMS?
|
|
|
the point is I can sit anyone down at a vms machine and they
would bee 100% more productive there compared to a unix
machine ... and not only would they be more productive, they
also would not have to become a member of the patch of the
day club, and have the worlds best tco and clustering ... |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 4:25 am | All times are GMT
|
|
Banruptcy | Hotels in Rome | Bleach Anime | Credit Card Offers | Fantasy
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|