I do have a variable containing one line like this:
Waiting for job XXXXXX to start
I needed to get the 'XXXXXX' literal, so I did the following:
Now, my variable is have more than line like that:
Waiting for job XXXXXX to start
Waiting for job YYYYYY to start
Now, I need to loop over all these lines, get the job name (XXXXXX, YYYYYY...) and execute what is in #other stuff for every single line, but I dont know how
The furthest I got is to get how many times I do have to iterate:
Unfortunately, my input is not having all lines with same format, moreover, like this
Quote:
LINE HELLO
Waiting for job XXXXXXX to start
LINE HOW ARE YOU DOING
LINE FINE
Waiting for job YYYYYY to start
Waiting for job ZZZZZZ to start
MORE LINES
So it is not enough for me just to loop all over the lines, but only those having my pattern
hi i just cant figure out how can i do this ls -lt > log.txt using $PWD
what i mean is how can i get the ls command content into a file using $PWD variable? :confused: (4 Replies)
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Hello All,
Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....?
I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping
through a string containing some of these "Illegal Characters". Now... (5 Replies)
I have a group of variables myLINEcnt1 - myLINEcnt10. I'm trying to printout the values using a for loop. I am at the head banging stage since i'm sure it has to be a basic syntax issue that i can't figure out.
For myIPgrp in 1 2 3 4 5 6 7 8 9 10; do
here i want to output the value of... (4 Replies)
Simple enough problem I think, I just can't seem to get it right.
The below doesn't work as intended, it's just a function defined in a much larger script:
CheckValues() {
for field in \
Group_ID \
Group_Title \
Rule_ID \
Rule_Severity \
... (2 Replies)
I am having one string like
./usr1/Server/temp/app.env ./usr1/Server/temp/upp/app.env ./usr1/Server/ORIG_temp/app.env ./usr1/Server/ORIG_temp/upp/app.env ./usr1/Server/work_temp_40/app.env ./usr1/Server/work_temp_40/upp/app.env ./usr1/fd/app.env ./usr1/PurgeArchive/app.env ./usr1/bm/bin/app.env... (6 Replies)
I want to address a variable content whose name is/matches the content of a given other variable.
i.e.
set name=´sam´
set ${name}_age=´27´
So, by typing: echo ${name}_age
I correctly obtain: sam_age
By typing: echo $sam_age
or echo ${sam_age}
I correctly obtain: 27
But how can I... (3 Replies)
I have a variable that contains filenames like this:
variable="file_1.extension<blank>file_2.extension<blank>file_3.extension<blank>file_4.extension and so on"
How can I make filenames to be separated by newline: (I tried Sed but it didn't worked well)
file_1.extension
file_2.extension... (6 Replies)
I got a sample BASH script like this :
$ cat test
MYVAR=$1
DUMMY1="This is tricky"
DUMMY2=24
echo $
$ ./test DUMMY1
./test: line 5: This is tricky: syntax error in expression (error token is "is tricky")
**I was expecting the output as "This is tricky", ah! but no luck
**But... (2 Replies)
Hi,
variable1="This is a car"
Now I want to replace the content of variable1, "car" to "dog". Is there any simple command I can use.
Thanks.
Joseph (4 Replies)