Search Results

Search: Posts Made By: mirwasim
2,059
Posted By Neo
Anything is possible, almost. Normally, it's...
Anything is possible, almost.

Normally, it's best to trigger remote shell script by methods other than sending email messages.

However, if you insist on running scripts based on email, there...
1,246
Posted By joeyg
Conceptual...
OK, then you have 3 programs running that create output.
Would seem that you would want to create one watcher program, perhaps run at regular interval via a cron job.
The watcher program would look...
1,872
Posted By Don Cragun
If the code you paste onto your screen doesn't...
If the code you paste onto your screen doesn't look like the code you copied from this site, then the code you are running is not the same piece of code that you were given.

So now you know that...
1,872
Posted By Don Cragun
Ah. Thank you. Finally a specification for the...
Ah. Thank you. Finally a specification for the part of the URL that you want...
awk -F, '
BEGIN {OFS = ", "
}
/Test failed/ {
match($(NF - 3), "http:.*/see/")
URL = substr($(NF - 3),...
1,944
Posted By Don Cragun
And... What rules are to be used when...
And...

What rules are to be used when deciding how to "reduce the URL length in same code"?
Exactly what output are you hoping to get from the three URLs you listed above?

Your example above...
1,944
Posted By RudiC
You can read it like prose: "If this line's...
You can read it like prose:
"If this line's first field does not equal the last valid URL, then print the header and retain field 1 as the new last valid URL"
1,944
Posted By RudiC
Try - although I'm afraid the result does not...
Try - although I'm afraid the result does not match your "Expected" -
awk -F, '
function HEADER() {print "<tr bgcolor=#85C1E9>"
print "<th>URL</th>"
...
1,639
Posted By Yoda
Ok, escape it:- sub ( /[^\/]*\//, X, $i )
Ok, escape it:-
sub ( /[^\/]*\//, X, $i )
2,655
Posted By RavinderSingh13
Hello mirwasim, It is showing like that...
Hello mirwasim,

It is showing like that output because you are giving an OR condition which means any of these words if they are coming into a line then print it(so that is why other than 1st...
2,655
Posted By jim mcnamara
One way. grep 'REREGISTER' test1 | grep...
One way.

grep 'REREGISTER' test1 | grep 'something'

A much more advanced way is to use negative lookahead.

Suppose you want to eliminate lines with the word "bar" in them:

egrep...
1,450
Posted By RudiC
Are you sure the input file is correctly shown?...
Are you sure the input file is correctly shown? The script is intended to read a multi line file with each line consisting of a string and a value (sort of what the shown "output" is), which your...
2,132
Posted By RudiC
"in front of" means IN FRONT OF! Not AFTER ...
"in front of" means IN FRONT OF! Not AFTER

{sub (/BAD REQUEST/, "BAD_REQUEST")
if ($3+0 >= 400) print "<tr style=\"color:#FF0000\">"
else print "<tr>"
2,132
Posted By RudiC
Put it just in front of the if ($3+0 >= 400).
Put it just in front of the if ($3+0 >= 400).
2,132
Posted By RudiC
1. Is it always the same field that needs to be...
1. Is it always the same field that needs to be checked (here: field 3)? Then you might try
awk '
BEGIN {print "<br />\n<html>\n<Body>\n<table border=\"1\">"
}
{if ($3+0 >= 400)...
839
Posted By Aia
No variable $lettert I would like to suggest...
No variable $lettert

I would like to suggest the following snip:

while IFS= read line; do
for word in $line; do
if [ -n $word ]; then
echo "${word}: ${#word}"
fi
...
839
Posted By bakunin
You have already been explained what led to the...
You have already been explained what led to the error you got. This is a side issue:
wcount=`echo $word | wc -m`

You should NOT use backticks for this kind of operation. If you want to run a...
839
Posted By MadeInGermany
Further quote $word, at least in if [ -n...
Further quote $word, at least in
if [ -n "$word" ]; then
This is because the shell evaluates it first then passes it to the [ ] test that will not see an empty string and might give a syntax...
839
Posted By Scrutinizer
Hi, for word in $line do if [ -n $word ]...
Hi,

for word in $line do
if [ -n $word ] then

should be
for word in $line
do
if [ -n $word ]
then
a newline may also be replace by a semicolon
3,114
Posted By Don Cragun
You said you're using bash as your shell, but...
You said you're using bash as your shell, but /bin/sh is an old Bourne shell; not a bash shell on SunOS systems. The following suggestion uses /bin/ksh instead of /bin/sh so we can use the more...
3,114
Posted By Don Cragun
If you would like for us to look at your script...
If you would like for us to look at your script and try to help you find out what is going wrong, yes! Or, you can choose not to post your script and we will have to assume that you don't want our...
3,114
Posted By vbe
To tell you the truth, what you have shown us so...
To tell you the truth, what you have shown us so far is of little help
as
DATE_3=`date | awk '{print $2,$3,$4}' is just assigning DATE_3 with the wanted value...
We have no idea where and what...
1,274
Posted By RudiC
Remove the double quotes around the colour code.
Remove the double quotes around the colour code.
1,274
Posted By RudiC
awk is treating #DC143C as the start of a comment...
awk is treating #DC143C as the start of a comment and does not execute the remainder of the line.
1,492
Posted By RudiC
... which would yield tp://server:port/abcd/. Do...
... which would yield tp://server:port/abcd/. Do you know what man pages are and are for?

cut -c15-37,99-121 file
http://server:port/abcd;subrequestId=123654789
is not quite what you seem to...
1,817
Posted By RudiC
It removes any space char from your input file.
It removes any space char from your input file.
Showing results 1 to 25 of 35

 
All times are GMT -4. The time now is 10:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy