- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script Help Needed
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
Forums
Discussions
Discussions
Forums
Discussions
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
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
04-24-2007 05:42 AM
04-24-2007 05:42 AM
Requirement :
We are using JBOSS as our java appl server, and need to have multiple instances of jboss servers runing on the box and for that to happen we need to extend the attached default file to have different port configurations currently the default file has a total of 3 configs - ports-default, ports-01, ports-02 and we need to extend that till ports ports-15.
I would like you all to help me in having a script which creates these additional port configurations.( eg. ports for ports-03 can be incremented by +1 in relation to ports-02 )
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2007 06:18 AM
04-24-2007 06:18 AM
Re: Script Help Needed
There are an awful lot of ports mentioned in there. Dozens per server definition.
It seems to me some need to be incremented by 100, not 1, like those 'rmiports' under
name="jboss:service=Naming"
You tell as EXACTLY which ports, to increment by how much and we might try for real.
Seems to me also you do not want to muck with this file directly. This stuff is clearly generated by a tool Use the tool to configure the extra servers?
Finally, to visuale this XML you can of course open it with the exploder under windoze, but you may want to try the "XML Notepad".
Google for: +"XML notepad" +site:microsoft.com
Good luck,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2007 08:18 AM
04-24-2007 08:18 AM
Re: Script Help Needed
A)Here is a sample ( attached ) of what I want ...ports-02 config is given along with comparable values from ports-01 and I want the same difference in each of my instances ( ports-03 onwards ... till ports-15 )
thanks for taking the challenge .
hunki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2007 08:33 AM
04-24-2007 08:33 AM
Re: Script Help Needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2007 08:36 AM
04-24-2007 08:36 AM
Re: Script Help Needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2007 11:59 PM
04-24-2007 11:59 PM
Re: Script Help Needed
Honestly, I would expect that the JBoss maintainers already have such tools up their sleeve (they really cannot expect an admin clicking through piles of pages in a browser).
I for one, would help myself by parsing this stuff with one of the many Perl XML parsers (e.g. XML::Simple, relies on libexpat I suppose).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2007 12:24 PM
04-25-2007 12:24 PM
Re: Script Help Needed
From the sample input provided it seems like some ports need unit increments while others need 100 increments? And what about strings like "ports-02"? Do these need to be incremented for the next port config which I presume will be 3?
I guess those are some of the issues that needs to be addressed before a viable method of solving this can be concocted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2007 07:38 AM
04-27-2007 07:38 AM
Re: Script Help Needed
Here are the answers to your queries :
Besides the XML parsing the script gets complicated owing to the presence of filenames that have numbers embedded in their names. For ex. the presence of number 4 in the "jboss-ws4ee.sar" filename. I don't suppose anything needs to be done with it? Meaning it does not need to be incremented?
Nope
From the sample input provided it seems like some ports need unit increments while others need 100 increments? And what about strings like "ports-02"? Do these need to be incremented for the next port config which I presume will be 3?
Yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2007 08:45 AM
04-30-2007 08:45 AM
Re: Script Help Needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2007 08:56 AM
04-30-2007 08:56 AM
Re: Script Help Needed
It would be rather easy to add arbitrary values to the "base" substition based upon a command-line option. This sounds much like a Perl script to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2007 09:27 AM
04-30-2007 09:27 AM
Re: Script Help Needed
# cc parsexml.c -o parsexml
# cat infile | parsexml
or
# parsexml
========================== parsexml.c ==========================
#include
#include
int main(void)
{
int c, buf;
while ((c = getchar()) != EOF) {
if (isdigit(c))
buf = c - '0' + 10 * buf;
else {
if (buf)
printf(buf>100?"%d":"0%d",buf>100?buf+100:buf+1);
putchar(c);
buf = 0;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 04:17 AM
05-01-2007 04:17 AM
Re: Script Help Needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2007 09:36 AM
05-01-2007 09:36 AM
Re: Script Help Needed
# cat infile | parsexml >outfile
or
# parsexml
~cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2007 02:10 AM
05-02-2007 02:10 AM
Re: Script Help Needed
thanks,
hunki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2007 09:25 AM
05-02-2007 09:25 AM
Solution# parsexml
The above command creates the config file for port 03. This file will become the input file for generating the config file for port 4...so on and so forth until all port configurations you need are exhausted i.e.
# parsexml
.
.
.
# parsexml
~hope it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 04:48 PM
05-06-2007 04:48 PM
Re: Script Help Needed
The program reads standard input (stdin), which can be redirected using the mechanisms provided by the shell, a character at a time scanning for digits. If the character read is not a digit then it is sent to standard output. On the other hand if the character is a digit then a local variable named "buf" collects them until a non-digit is encountered. At this point the integer variable "buf" is printed to standard output along with the non-digit character just read.
There are atleast a couple of ambiguities that are hard to resolve; one is the presence of digits within a filename which certainly is not up for incrementing and another is which numeric string needs to be incremented by 1 and which by 100. Hope it makes sense and hope it helps.
~cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2007 04:29 AM
05-07-2007 04:29 AM