- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Begining of lline search
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 05:13 AM
тАО09-27-2010 05:13 AM
Begining of lline search
Can anyone please update me in OpenVMS how to do a begining/start of line search , somthing like 'grep ^text' which searches for 'text' at the begining of line in unix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 05:27 AM
тАО09-27-2010 05:27 AM
Re: Begining of lline search
To begin: WELCOME to the VMS Forum!
Your question immediate leads to another:
WHICH VERSION of OpenVMS?
Recent versions DO have something similar to this capability...
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 05:45 AM
тАО09-27-2010 05:45 AM
Re: Begining of lline search
http://h71000.www7.hp.com/opensource/gnv.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 05:48 AM
тАО09-27-2010 05:48 AM
Re: Begining of lline search
Standard OpenVMS search does not have this.
Just use gnu/gnv grep, awk or perl to do this, on OpenVMS.
$ perl -ne "print if /^text/" x.x
(Un)fortunately perl opens (input) files exclusively.
So if you need to search a live (log) file, then you need an explicit open such as:
$fh = vmsopen( $file, qw( shr=put mbc=112 mbf=4))
Good luck!
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 06:34 AM
тАО09-27-2010 06:34 AM
Re: Begining of lline search
$ awk :== $SYS$COMMON[SYSHLP.EXAMPLES.TCPIP.SNMP]GAWK.EXE
and then you can do
$ ty test.tmp
Port123
ABC Port
$ ty bb.awk
/^Port/ { print }
$ awk/input=bb.awk test.tmp
Port123
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 06:43 AM
тАО09-27-2010 06:43 AM
Re: Begining of lline search
If you're willing to run with a slow search (and akin to the VMS SEARCH command), then use grep available via the GNV tools, or one of the available add-on grep or egrep tools.
Or load and use perl or other such, which have similar (low) performance.
Or roll your own DCL loop to do this stuff.
Or (if you're finding yourself doing more of these searches) then remote-mount the disk structure or replicate the disk structure, and index it, and search it from a box that has indexing and search capabilities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 07:40 AM
тАО09-27-2010 07:40 AM
Re: Begining of lline search
spelling-advice) command procedure which does
something like the following. (Note that
"/format = nonulls" would be unnecessary for
a typical input file, but this example file
is atypical.)
Too simple:
alp $ search /format = nonulls -
sys$library:vms$password_dictionary.data searche
researcher
researchers
researches
searched
searches
Better:
alp $ search /format = nonulls -
sys$library:vms$password_dictionary.data searche -
/key = (pos = 1, siz = 'f$length( "searche")')
searched
searches
Of course, a working "grep" might be easier.
(The spelling advice would be better if that
word list didn't contain so many misspelled
words, but it is cheap and available.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 07:53 AM
тАО09-27-2010 07:53 AM
Re: Begining of lline search
$ search somefile text*/wild=strict
or
$ search somefile text/key=(pos:1,siz:4)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 08:01 AM
тАО09-27-2010 08:01 AM
Re: Begining of lline search
e.g
http://digiater.com/openvms/freeware/v60/find015/
Purely Personal Opinion