- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: search command search-string - how search for ...
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
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
тАО03-09-2007 09:28 AM
тАО03-09-2007 09:28 AM
We have some software programs that generate log files which we must search. The target string includes not just one single quote and some specific character, but: "... 'A' "
How may we avoid DCL string substitution parsing to look for the text string 'A' in several files using the OpenVMS SEARCH command?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 09:40 AM
тАО03-09-2007 09:40 AM
Re: search command search-string - how search for '<char>' ?
entirely clear.
What's wrong with this?:
alp $ type apo.txt
abcdefg
abc'defg
abcd'efg
abc'd'efg
alp $ sea a*.txt "'d'"
******************************
ALP$DKA0:[SMS]APO.TXT;1
abc'd'efg
Inside quotation marks (""), you need two
apostrophes ('') to get symbol evaluation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 09:45 AM
тАО03-09-2007 09:45 AM
Re: search command search-string - how search for '<char>' ?
computer programs? (You have some time to
think this over. I need to go to the local
Home Depot now to buy some hardware bolts and
hardware nuts.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 10:25 AM
тАО03-09-2007 10:25 AM
Re: search command search-string - how search for '<char>' ?
The text log file contains items such as
...A=''B''...
XYZ...B=''C''...
AABBCCDD...A=''D''...
where we must find two adjacent single quotes (apostrophes) a character and then two more adjacent single quotes.
search *.log "A=''D''"
%SEARCH-I-NOMATCHES, no strings matched
because of symbol substitution. I need to turn off symbol substitution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 10:56 AM
тАО03-09-2007 10:56 AM
Re: search command search-string - how search for '<char>' ?
...A=''B''...
XYZ...B=''C''...
AABBCCDD...A=''D''...
A = "B"
$ sea test.quot """B"""
A = "B"
$ sea test.quot "'"+"'B'"+"'"
...A=''B''...
XYZ...B=''C''...
AABBCCDD...A=''D''...
$
Because the fonts here display two single quotes as if it were a dowble quote, I have attached a text file you can view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 11:39 AM
тАО03-09-2007 11:39 AM
Re: search command search-string - how search for '<char>' ?
In other words, to search for all occurrences of two adjacent single quotes, use:
$ search file "'"+"'"
Since this font doesn't display well, that's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 12:06 PM
тАО03-09-2007 12:06 PM
Re: search command search-string - how search for '<char>' ?
The multiple strings that we think would be concatenated appear to be treated individually by search. I get false matches on unwanted lines in the file.
Next attempt:
I use /MATCH=AND to get what I want for now temporarily; but I am not yet understanding why the strings are not combined and treated as one search-string.
It appears that the DCL SEARCH command identically treats the commands
$ search test.quot "'"+"'B'"+"'"/match=and
and
$ search test.quot "'","'B'","'"/match=and
so I am assuming that string concatenation is NOT happening.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 12:55 PM
тАО03-09-2007 12:55 PM
Re: search command search-string - how search for '<char>' ?
$ text = "'" + "'%'" + "'"
$ sho symb text
TEXT = "''%''"
$ sea tmp.tmp &text/wild
The & forces 'deferred substitution'.
With PERL on any VMS version the single quotes are still nasty when expressed in a 'one liner'. So I would use 'octal' notation:
$ perl -ne "/\047\047.\047\047/" tmp.tmp
Now if you just want to match on say B and D, not C then change that to :
$ perl -ne "print if /\047\047[BD]\047\047/" tmp.tmp
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 01:29 PM
тАО03-09-2007 01:29 PM
Re: search command search-string - how search for '<char>' ?
We will be testing version 8.3 on Integrity soon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 02:07 PM
тАО03-09-2007 02:07 PM
Re: search command search-string - how search for '<char>' ?
and not just any single character, then "&"
seems to help:
alp $ ss = "'"+ "'"+ "d"+ "'"+ "'"
alp $ write sys$output ss
''d''
alp $ sea a*.txt &ss
******************************
ALP$DKA0:[SMS]APO.TXT;2
abc''d''efg
where:
alp $ type apo.txt
abcdefg
abc'defg
abcd'efg
abc'd'efg
abc'defg
abcd'efg
abc'd'efg
abc''defg
abcd''efg
abc'd''efg
abc''d'efg
abc''d''efg