I have a list of Servers in no particular order as follows:
And I am generating some output from a pre-existing script that gives me the following (this is a sample output selection).
For each SERVERNAME in ${virtualMachines} I want to extract each section beginning with "Normal backup" and ending with "Duration" to a file.
The Server name is a constant and will always appears in the "Normal backup/Duration" block of output (typically as "Copying $SERVERNAME" but this can change if it has an error but is always there). So it's kind of like a grep of the $SERVERNAME that also grabs the "Normal backup -> Duration" section that the $SERVERNAME exists within. This also needs to append to the file as sometimes the backup of each server might run more than once and produce more than 1 "Normal backup -> Duration" section.
Another way to describe it would be...
Output only "Normal backup -> Duration" section where $SERVERNAME = IIBSBS and append output to /tmp/vdrlog-IIBSBS.txt
e.g. it would look something like this. My script is just to try and illustrate what I want and does not work.
I previously had great help from Franklink52 in this thread which is what was using to grab the sections but I am updating the script so it accounts for situations where sometimes the backup will run more than once or if errors occur in the backup.
Hi Guru's,
I am new to unix scripting. I have a huge file with user details in it(file2) and I have another file with a list of users(file1). Script has to search a user from file1 and get all the associated lines from file2.
Example:
fiel1:
cn=abc
cn=DEF
cn=xyx
File 2:
dn:... (10 Replies)
I have searched in a variety of ways in a variety of places but have come up empty.
I would like to prepend a portion of a section header to each following line until the next section header. I have been using sed for most things up until now but I'd go for a solution in just about anything--... (7 Replies)
Hi Everyone,
I need some help to accomplish the below. help is highly appriciated.
I have a 45 mb file with ldap entries. Each user entry is separated by a string # entry-id: 1 and so on. Some of the entries has a string xyz: true. I want to delete the section if the user section has xyz: true... (6 Replies)
Hello Team ,
I have to extract date section from the below file output. The output of the file is as shown below.
I have to extract the "" this section from the above output of the file. can anyone please let me know how can we acheive this? (4 Replies)
Hi,
I have a file formated like this:
John 7.22 2010-01-25_17:01:36
George 8.22 2010-01-25_17:02:36
Bob 9.62 2010-01-25_17:04:36
Jane 10.11 2010-01-25_17:05:36
Emma 4.52 2010-01-25_17:01:36
What I want to do is cut out only the entries that have... (2 Replies)
Hi,
I understand either AWK or SED can do this, but I not sure how to extract the following configuration in section. Meaning when I need to find code with " ip helper-address 192.168.11.2" , it would start from "interface Serial0/0" and "interface FastEthernet0/1". Only displaying both section... (2 Replies)
hi, i have a very long text file. i need to extract with grep command a certain part.
for example text file include 1ooo rows:
1....
2...
3...
.
.
.
1000
i want to view with grep only rows 50-100.
any ideas will be appreciated
thanks... (8 Replies)
I need to get a section of a file based on 2 params. I want the part of the file between param 1 & 2. I have tried a bunch of ways and just can't seem to get it right. Can someone please help me out.....its much appreciated. Here is what I have found that looks like what I want....but doesn't... (12 Replies)