- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Using F$Parse to grab a version number
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
тАО08-08-2007 03:55 AM
тАО08-08-2007 03:55 AM
An test I just did:
$ dir net$server.log
Directory DISK$ICS:[DYSON]
NET$SERVER.LOG;657 NET$SERVER.LOG;656
Total of 2 files.
$ x = f$parse ("NET$SERVER.LOG",,,"VERSION")
$ sho sym x
X = ";"
What am I missing or doing wrong? I wanted to see the string "657". The on-line help suggests to me it should:
field
Specifies a character string containing the name of a field
in a file specification. Specifying the field argument causes
the F$PARSE function to return a specific portion of a file
specification.
Specify one of the following field names (do not abbreviate):
NODE Node name
DEVICE Device name
DIRECTORY Directory name
NAME File name
TYPE File type
VERSION File version number
Thanks,
Rick
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2007 04:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2007 04:19 AM
тАО08-08-2007 04:19 AM
Re: Using F$Parse to grab a version number
That will provide me with what I am looking for! I guess I just am reading the on-line help wrong for the F$Parse. It see it parses the literal string that is provided and if no version number is provided, it comes up empty. I read it that it takes the filespec and provides you with the version number (and I assumed unless otherwise specified, the current highest number). Apparently not. :)
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2007 04:34 AM
тАО08-08-2007 04:34 AM
Re: Using F$Parse to grab a version number
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2007 05:17 AM
тАО08-08-2007 05:17 AM
Re: Using F$Parse to grab a version number
What problem might you be seeking to address here?
If it's renumbering the versions of the NETSERVER log files lower and/or dealing with the impending ;32767 version, there's an easier way, assuming you can quiesce the environment briefly: http://64.223.189.234/node/456
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2007 05:29 AM
тАО08-08-2007 05:29 AM
Re: Using F$Parse to grab a version number
it is not netserver, per say. It is actually a problem with Process Software's SSH server. We are seeing as many as 10's of thousands of SSH connections per day tyring brute force password hacks. Each attempt opens a SSHD.LOG file. When the version gets to 32767, it starts doing crazy things, sometimes denying access, other times putting log session contents into data streams that are occurring in the session that does connect, etc.
Netserver (net$server) has caught me in the past, but never over and over again on time scales of a few days. More like once every few years. :)
I wanted a quick way to monitor the current version number and notify me of it approaching some threshold.
I did not fully grasp the description. I think I got it now once I saw an example of how Karl suggested using it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2007 01:45 PM
тАО08-08-2007 01:45 PM
Re: Using F$Parse to grab a version number
I'd definitely ring up Process and see if they can rework sshd some to avoid this situation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2007 03:00 PM
тАО08-08-2007 03:00 PM
Re: Using F$Parse to grab a version number
comp.os.vms thread:
http://groups.google.com/group/comp.os.vms/browse_thread/thread/4870fa27fc358aaa/8efd1a993fc1a8f9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-08-2007 04:56 PM
тАО08-08-2007 04:56 PM
Re: Using F$Parse to grab a version number
$ DIRECTORY /SELECT=VERSION=MINIMUM=30000 disk:[000000...]*.*;
Once found, assuming a reasonably quiescent system, you can reset the version numbers with:
$ RENAME file.typ;* file.typ_TMP;
$ RENAME file.typ_TMP; file.typ;
This will take all existing versions of a file and renumber them in the same sequence starting from 1. The trailing semicolon is required.
Here's a procedure either reset a single file, or search for, and reset them:
VERSION_RESET.COM
$ IF F$EXTRACT(0,1,p1).EQS."#"
$ THEN
$ target=p1-"#"
$ GOTO 'target'
$ ENDIF
$
$ files=F$PARSE(";",p1,"SYS$DISK:[000000...]*.*;")
$ lim=p2
$ IF lim.EQS."" THEN lim="30000"
$ PIPE DIRECTORY/NOHEAD/NOTRAIL/SELECT=VERSION=MINIMUM='lim' 'files' | -
@'F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))' #PROCESS SYS$PIPE
$ EXIT
$
$ PROCESS:
$ IF p2.EQS."" THEN p2="SYS$PIPE"
$ OPEN/READ in 'p2'
$ loop: READ/END=EndLoop in line
$ @'F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))' #RESET 'line'
$ GOTO loop
$ EndLoop: CLOSE in
$ EXIT
$
$ RESET:
$ typ=".$"
$ IF F$PARSE(p2,,,"TYPE").EQS.typ THEN typ=".Z"
$ RENAME 'F$PARSE(";*",p2)' 'F$PARSE(";",typ,p2)'
$ RENAME 'F$PARSE(";*",typ,p2)' 'F$PARSE(";",p2)'
$ EXIT
usage:
to search for and reset multiple files
$ @VERSION_RESET filespec [minimum-version]
or for a single file
$ @VERSION_RESET #RESET filespec
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2007 12:08 AM
тАО08-09-2007 12:08 AM
Re: Using F$Parse to grab a version number
If you want a 'one-liner', try
$ X = $f$elem(1,";",f$search("NET$SERVER.LOG",))
Dave