I have a file which contains like this:
I want to test each line if there is/are errors, error/s would appear like this below:
I want a script (perl or shell) that will check each line of the file, then if error is found (e.g. 101 <details>) it will return an output something like this:
but if not it will return
ty
Your command works! Btw, would appreciate more if you could give a brief explanation of your code/command.
Thanks again,
rymnd_12345
---------- Post updated at 02:07 AM ---------- Previous update was at 01:35 AM ----------
Hi CarloM,
I would like to seek your assistance again on this matter Sir. I have a file that looks like this:
I want a simple code that will check each line of the file. Let's say for example for server1, System = active (will prompt an error if not active), Monitor = running (will prompt an error if not running) and Modules = running (n/n (e.g 92/92)) (it will prompt an error if modules is not running and numerator is not equal to denominator (e.g 90/92).
Hope you could help me again.
Br,
rymnd_12345
---------- Post updated at 04:01 AM ---------- Previous update was at 02:07 AM ----------
Hi CarloM/All,
I have a file which looks like this
And here is my code, but I cannot print the "Modules: running (with not equal count, e.g is (90/97))"
Question is, how can insert in the code lets say if it monitored something in the line
As you can see 7 processes are not running, how to print this lines with lacking processes only.
Try this: split($3, counts, "\\(|/|\\)") creates the counts[] array by splitting the 3rd field using separators '(', ')' and '/' - you may not need both the backslashes, depending on which awk you have.
---------- Post updated at 07:49 AM ---------- Previous update was at 06:13 AM ----------
Hi CarloM,
You might want to help me again (pardon I'm really a beginner in programming)
I have a file which looks like this:
I want to check each line this time particularly the Use% if it has reached already or equal to the threshold that we've set which is 85%, if it is equal or more than the set threshold, it will prompt the user that
, else output will be Diskspace Status = ok.
I have a .csv file that has been create from a google form and I need to extract the data from it that has been entered by users.
The CSV will have anywhere between 100 and 1000 lines which comprise entr data for a sports carnival
A few typical line is shown here to show the problem I have
... (19 Replies)
Hi folks,
I am self-learning as I can
I have a script that has read a file into an array.
I can read out each line in the array with the code:
for INDEX in {0..$LENGTH} ## $LENGTH was determined at the read in
do
echo "${data}"
done
What I need to do is test the first char... (2 Replies)
i need to get least lines of file after last word TEST in file, and send that lines to mail
example of file structure:
TEST 10.10.2010
jdfjdnjfndjfndnfkdk
djfjdnfjkdjkfnjkdfk
jdfjdjfnjdjnfjkdnfjk
TEST 11.10.2010
jdjfnjdnfdkdfjdfjdnk
jdnfjdnjkfndnfjdnfjk
fjdnfjkndnfdfnjdnfjk
TEST... (6 Replies)
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)