Search Results

Search: Posts Made By: gencon
7,317
Posted By gencon
Hi Don, The current script would not...
Hi Don,



The current script would not match all those and wouldn't have since I moved to an Awk only solution. I posted about this in post num 17, see paragraph "The code has failed to handle...
7,317
Posted By gencon
...and just because this might be of interest: ...
...and just because this might be of interest:





I've had a look into the question I've placed in bold above...

I created a dataset of 5 million numbers each with a random number of...
7,317
Posted By gencon
Hi Don, Obviously absolutely no apology...
Hi Don,


Obviously absolutely no apology needed whatsoever. I hope you had a great time with your grandkids.



Yes. Thanks for the excellent explaination, now I get it.

Chubler_XL: My...
7,317
Posted By gencon
NOTE: Scrutinizer - see bottom of this post. ...
NOTE: Scrutinizer - see bottom of this post.

Hi again and thanks Chubler_XL,



That's exactly what I thought/think too. BUT strange things are going on, read on...

What I don't understand...
7,317
Posted By gencon
Hi Don, Thanks for such a comprehensive...
Hi Don,

Thanks for such a comprehensive reply. Some points for me to answer and some questions to ask.

On the use of local variables it simply didn't occur to me that this was not standardized....
7,317
Posted By gencon
Hi Chubler_XL and Don, Thanks again guys,...
Hi Chubler_XL and Don,

Thanks again guys, your support is appreciated.



Yes, my apologies. I misread it as having the double quotes escaped. Oops. That's now back in the code.

I've also...
7,317
Posted By gencon
Thanks very much Chubler_XL. That's an excellent...
Thanks very much Chubler_XL. That's an excellent way to do it and what I've used with some changes.

Your IP regex code IP_RE="[0-9]+\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]+" is not Posix compatible....
7,317
Posted By gencon
[EDIT: Forget the below - I'll re-write without...
[EDIT: Forget the below - I'll re-write without using -o, may as well get it right. I wrote the below before noticing Don's latest reply, having spotted the possible problem with sed -E myself. I...
7,317
Posted By gencon
Thanks. That is an ever so slightly more elegant...
Thanks. That is an ever so slightly more elegant solution and the one which I shall in fact use. Don will get over it eventually, I'm sure it's nothing that some intensive therapy won't cure. :p
...
7,317
Posted By gencon
Thanks Don, that is a perfect solution. [No, they...
Thanks Don, that is a perfect solution. [No, they will never be on the same line.]

I should have been looking at the grep man page instead of scratching my head trying to work out a regex...
7,317
Posted By gencon
Grep regex to ignore sequence only if surrounded by fwd-slashes
Hi,

I've got a regex match to perform in a Bash script and can't quite get it right.

Basically I want to match all IP address like sequences in a file which may or may not contain an IP address...
5,320
Posted By gencon
Thanks again Don, got it. I think I'll use...
Thanks again Don, got it. I think I'll use (pattern) in future cos it looks funkier. :cool:

I haven't used vi since my Solaris 2.x days at university but never fully mastered all the keys.
...
5,320
Posted By gencon
Don, What a thoroughly helpful and...
Don,

What a thoroughly helpful and informative post, thank you so much. It has helped me to understand what's going on and to resolve my issue with ease. You obviously went to great effort to help...
5,320
Posted By gencon
That is a very good point. :) I didn't think...
That is a very good point. :) I didn't think about that as the script does not take a filename as input. Oops.

I suppose that after the getopts loop has finished I could loop through the args...
5,320
Posted By gencon
Getopts how to handle missing '-' in command line args.
I'm using getopts to process command line args in a Bash script. The code looks like this:

while getopts ":cfmvhs:t:" option; do

case $option in

c) operationMode="CHECK"
...
6,797
Posted By gencon
Thanks again. I'll take your advice and use...
Thanks again.

I'll take your advice and use that instead in the future. I've used '**' as a field separator for (my system's) awk in the past so I knew it worked. It's clearly a bad habit which I...
6,797
Posted By gencon
Thanks Scrutinizer, that works. I thought...
Thanks Scrutinizer, that works.

I thought that anything before the awk {} was before the first line. Oops, so obvious once you know. :b:

To anyone who's interested, this also works:

$ find ....
6,797
Posted By gencon
Problem piping find output to awk, 1st line filename is truncated, other lines are fine.
Today I needed to take a look through a load of large backup files, so I wrote the following line to find them, order them by size, and print the file sizes in GB along with the filename. What...
4,338
Posted By gencon
That's it !! All is now working. Well done, it...
That's it !! All is now working. Well done, it never occurred to me that LANG would have an impact on grep.

Thanks so much.
4,338
Posted By gencon
Good idea, [[:print:]] works too. The...
Good idea, [[:print:]] works too.

The problem now is that all my tests have involved testing from a terminal, running the script from crontab stops the regexes from working (though everything else...
4,338
Posted By gencon
Thanks for the suggestion but using -F with grep...
Thanks for the suggestion but using -F with grep did not work.

However I have diagnosed the problem...

The web page in question (url below) is being searched for the string "Currently out of...
4,338
Posted By gencon
Grep text matching problem with script which checks if web page contains text.
I wrote a Bash script which checks to see if a text string exists on a web page and then sends me an email if it does (or does not e.g. "Out of stock"). I run it from my crontab, it's quite handy...
9,448
Posted By gencon
Ok thanks again for the help. Anyone else...
Ok thanks again for the help.

Anyone else got further info. on this?

Cheers all.
9,448
Posted By gencon
Thanks Corona. Ok, got it. In the...
Thanks Corona.


Ok, got it.


In the absence of any other ways of doing it (anyone?), which would you think was most likely to work with different flavours of Unix/Linux and Gnome v.2 or 3? Or...
9,448
Posted By gencon
DBUS_SESSION_BUS_ADDRESS for script called from crontab.
Hi,

I'm writing a Bash script for wallpaper clocks which works fine on the command line but needs to be run every minute from a crontab entry so the time gets changed on the wallpaper (the...
Showing results 1 to 25 of 51

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