The input looks like below
I am going in Loops and assigning the values of Sev ATOM and Count to 3 variables in each line and
varSEV=... (should get CRITCAL for line having SEV=CRITICAL)
varCount=... (should get 2 for line having COUNT=2)
varATOM=... (should get KUDDBASEGROUP00.db_name for line having ATOM=KUDDBASEGROUP00.db_name)
I was trying using sed and regex but failed miserably and two days gone in this (I thought will be simple thing)
Please help
Last edited by Franklin52; 12-30-2013 at 11:57 AM..
Reason: Please use code tags
Not clear. We have lines, that have SEV in them, lines with SEV and ATOM, others with those two and COUNT, and many not having any of those. On top, the Guessing wildly, I infer that in a shell loop you want to assign those three values to three variables, but only from lines that have all three in them? Try this:
This depends on the three values to occur in the same sequence in all lines. If that's not the case, you'd need to use e.g. awk.
Yes some lines will have all three some will have just one. Some might not have any.
I am going through the loop and just want to pick the values of each item in a variable
The intended result should be :
PDF converters
'empty line'
gpdftext and pdftotext?xml version="1.0"?>
xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters
gpdftext and pdftotext</note-content>... (9 Replies)
I need assistance with following requirement, I am new to Unix.
I want to do the following task but stuck with file creation date(sysdate)
Following is the requirement
I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Fairly straightforward, but I'm having an awful time getting what I thought was a simple regex to work. I'll give the command I was playing with, and I'm aware why this one doesn't work (the 1,3 is off the A-Z, not the whole expression), I just don't know what the fix is:
Actual Output(s):
$... (5 Replies)
Hi,
I'm attempting to rename some files that have spaces in them. Without linking sed commands together is it possible to replace the first three "." to " ".
File.name.is.long.ext -> File name is long.ext
I can get the desired effect with
echo "File.name.is.long.ext" | sed 's/\./ /g;s/... (5 Replies)
why does sed 's/.* //' show the last word in a line
and
sed 's/ .*//' show the first word in a line? How is that blank space before or after the ".*" being interpreted in the regex?
i would think the first example would delete the first word and the next example would delete the second... (1 Reply)
guys,
I need to know how to assing pattern matched string as an input command variable. Here it goes'
My script is something like this.
./routing.sh <Server> <enable|disable>
## This Script takes an input <Server> variable from this line of the script ##
echo $1 | egrep... (1 Reply)
Hello,
I am trying to covert a for statement into a single awk script and I've got everything but one part.
I also need to execute an external script when "not found", how can I do that ?
for TXT in `find debugme -name "*.txt"` ;do
FPATH=`echo $TXT | sed 's/\(.*\)\/\(.*\)/\1/'`
how... (7 Replies)
Hi Friends,
REQUIREMENT: Want to delete files from the current directory match with the same in the file test.txt
set -x
i=1
echo "i=$i"
COUNT=`sed -n '$=' test.txt`
echo "Count=$COUNT"
while
do
"## Here is error##"
FILETOREMOVE=`sed -n \'$i,1p\' test.txt`
echo $FILETOREMOVE... (5 Replies)