I am trying to script a query of a backup server that will display sessions that are "waiting" for a mount...
So for, i query my system which returns a process # that is waiting...
The output looks like this:
I then try to extract the number of seconds it has been waiting. That way, if it is considered too long, i can cancel it...
So far, here is what i have...
The result of "$WAITING" is displayed above. I tried sed using examples and the such but the last one i tried is showing me -after- the word "seconds". What i would like is to export the #### of seconds to my $RESULT. keep in mind that the seconds could be 1, 20, 300, 4335 etc...never the same lenght...
There could be 2 "waiting". One "waiting for access to output volume" and one "waiting for access to input volume"
I'd like to grab either or both if possible...
BTW, i am reading through some "sed" doc...but man...
Thanks.
Last edited by Franklin52; 05-07-2011 at 09:18 AM..
Reason: Please use code tags
Thanks, that seems to do the trick for now... Will this capture 2 "waiting" in the same string if it happens?
here is the result with your "sed"
These are the processes waiting: 21,174
21,174 Migration Disk Storage Pool DISKORA_COMMON, Moved Files: 0, Moved Bytes: 0, Unreadable Files: 0, Unreadable Bytes: 0. Current Physical File (bytes): 3,357,495,296 Waiting for access to output volume 211572L4 (36764 seconds).
Thanks, that seems to do the trick for now... Will this capture 2 "waiting" in the same string if it happens?
21,174 Migration Disk Storage Pool DISKORA_COMMON, Moved Files: 0, Moved Bytes: 0, Unreadable Files: 0, Unreadable Bytes: 0. Current Physical File (bytes): 3,357,495,296 Waiting for access to output volume 211572L4 (36764 seconds).
36764
No, it will only display the number which is in the trailing "(36764 seconds)" i.e. 36764
---------- Post updated at 03:52 PM ---------- Previous update was at 03:51 PM ----------
I have a file storing some text
and another file storing some numbers
I want to display characters other than the specified place of strings
one.txt
xyz abc 233 skfo 4r443
sfs abc abcd sd fsdf sdfd
abc 11 abc 33 abc dsaf
two.txt
Nt_djd_k='5-6,7-9'
Nt_hh_l='3-6,7-8'
a=`grep... (4 Replies)
Hi,
I'm working on a project that requires formatted text to be displayed on the screen plugged into a Linux machine. I want to be able to control this text via a bash script and format it in a particular font and size. Changing the background colour would also be beneficial.
Does anyone know... (3 Replies)
I have a requirement to display a part of an html response that my application gets. The response looks like this:
<html><a href='com.aprisma.spectrum.app.sd.client.SDHyperlinkHandler' sdTicketHandle='cr:419900' ocAlarmId='506618ea-f013-102d-02a7-0050569d7aa8'... (3 Replies)
Hi, I have a single colum file and I need to reformat the file so that it creates a new line every time it come to an IP address and the following lines are corresponding rows until it comes to the next IP address.
I want to turn this
172.xx.xx.xx
gwpusprdrp02_pv
seinwnprd03... (7 Replies)
Hello All,
I am currently having an issue displaying a exponent value using perl,
I have a perl program which generates an xls file. This xls is populated with values from a database. But for a certain column which I have made explicitely text and also implemented keep_leading_zeroes()... (3 Replies)
What would be the most succinct way of doing this (preferably in 1 line, maybe 2):
searching the first 10 characters of every line in a text file for a specific string, and if it was found, print out characters 11-20 of the line on which the string was found.
In this case, it's known that there... (13 Replies)
Hi guys! I am very much new to UNIX...and I was just wondering on how you would display this text format in UNIX with only just one command :
Text 1
Text 2
Text 3
Texts are in aligned vertically in such format...Thanks for your help :) (8 Replies)
Hi,
My requirement is that I should search for a particular string and display the string only once if there is more occurrence of the same string in a file.
e.g In the given below log file,the string AMQ5037 comes twice.I want to search for this string and display it only once.grep will... (5 Replies)
I am having issue dispalying text file in browser using perl.
Here is my code:
#!/usr/bin/perl
print "content-type: text/html \n\n";
open (FH , "access.log") || die "Blah $!";
while (<FH>) {
print $_ ;
}
I have correct permissions and everything. The weired thing is when I... (1 Reply)