Tony Mountifield wrote:
> In article
> ,
> wrote:
>> Warren Young wrote:
>> > On Oct 25, 2017, at 10:02 AM, Mark Haney
>> wrote:
>> >>
>> >> I have a file with two columns 'email' and 'total' like this:
>> >>
>> >> m...@example.com 20
>> >> m...@example.com 40
>> >> y...@domain.com 100
>> >> y..
On Wed, Oct 25, 2017 at 10:47:12AM -0600, Warren Young wrote:
> On Oct 25, 2017, at 10:02 AM, Mark Haney wrote:
> >
> > I have a file with two columns 'email' and 'total' like this:
> >
> > m...@example.com 20
> > m...@example.com 40
> > y...@domain.com 100
> > y...@domain.com 30
> >
> > I need
Once upon a time, Warren Young said:
> I was trying to think of which languages I know well which require even more
> difficult solutions than the Bash 4 one. It’s a pretty short list: assembly,
> C, and MS-DOS batch files. By “C” I’m including anything of its era and
> outlook: Pascal, Fortr
On 10/25/2017 3:34 PM, Warren Young wrote:
On Oct 25, 2017, at 11:28 AM, Mark Haney wrote:
An associative array was the first thing I thought of, then realized BASH
doesn't do those.
But it does: in Bash 4, only.
If you mean you must still use Bash 3 in places, then yeah, you’ve got a
probl
On Oct 25, 2017, at 11:28 AM, Mark Haney wrote:
>
> An associative array was the first thing I thought of, then realized BASH
> doesn't do those.
But it does: in Bash 4, only.
If you mean you must still use Bash 3 in places, then yeah, you’ve got a
problem… one probably best solved by switchi
In article ,
wrote:
> Warren Young wrote:
> > On Oct 25, 2017, at 10:02 AM, Mark Haney wrote:
> >>
> >> I have a file with two columns 'email' and 'total' like this:
> >>
> >> m...@example.com 20
> >> m...@example.com 40
> >> y...@domain.com 100
> >> y...@domain.com 30
> >>
> >> I need to get th
On Wed, Oct 25, 2017 at 12:08 PM, Robert Arkiletian wrote:
> On Wed, Oct 25, 2017 at 9:59 AM, Robert Arkiletian wrote:
>> On Wed, Oct 25, 2017 at 9:41 AM, Mark Haney wrote:
>>> On 10/25/2017 12:33 PM, Robert Arkiletian wrote:
here is a python solution
#!/usr/bin/python
#pytho
On Wed, Oct 25, 2017 at 9:59 AM, Robert Arkiletian wrote:
> On Wed, Oct 25, 2017 at 9:41 AM, Mark Haney wrote:
>> On 10/25/2017 12:33 PM, Robert Arkiletian wrote:
>>>
>>> here is a python solution
>>> #!/usr/bin/python
>>> #python 2 (did not check if it works)
>>> f=open('yourfilename')
>>> D={}
Jason Welsh wrote:
> hrm.. seems like you were missing a }
>
> sort file | awk '{array[$1] += $2;} END { for (i in array) {print i "\t"
> array[i];}}'
>
Oops. Well, it's not vi, it's webmail, so I couldn't check... Thanks.
mark
>
> regards,
>
> Jason
>
>
>
> On 10/25/2017 01:24 PM, m.r..
hrm.. seems like you were missing a }
sort file | awk '{array[$1] += $2;} END { for (i in array) {print i "\t"
array[i];}}'
regards,
Jason
On 10/25/2017 01:24 PM, m.r...@5-cent.us wrote:
Warren Young wrote:
On Oct 25, 2017, at 10:02 AM, Mark Haney wrote:
I have a file with two column
Not enough experience with the mainframe: I meant WinDoze.
- Original Message -
From: "m roth"
To: "centos"
Sent: Wednesday, October 25, 2017 1:02:54 PM
Subject: Re: [CentOS] [OT] Bash help
Leroy Tennison wrote:
> No kidding, but in that "other OS" the answer to the question "how can I
Leroy Tennison wrote:
> No kidding, but in that "other OS" the answer to the question "how can I
> create that report" is usually "You can't unless you spend money for a
> third-party application".
>
"Other", singluar? Did you mean WinDoze, or on an IBM mainframe, or...?
mark "been around the
Mark Haney wrote:
> On 10/25/2017 01:24 PM, m.r...@5-cent.us wrote:
>>>
>>> This screams out for associative arrays. (Also called hashes,
>>> dictionaries, maps, etc.)
>>>
>>> That does limit you to CentOS 7+, or maybe 6+, as I recall. CentOS 5
>>> is definitely out, as that ships Bash 3, which l
On 10/25/2017 01:24 PM, m.r...@5-cent.us wrote:
This screams out for associative arrays. (Also called hashes,
dictionaries, maps, etc.)
That does limit you to CentOS 7+, or maybe 6+, as I recall. CentOS 5 is
definitely out, as that ships Bash 3, which lacks this feature.
Associative arrays?
No kidding, but in that "other OS" the answer to the question "how can I create
that report" is usually "You can't unless you spend money for a third-party
application".
- Original Message -
From: "m roth"
To: "centos"
Sent: Wednesday, October 25, 2017 12:27:28 PM
Subject: Re: [CentOS]
Warren Young wrote:
> On Oct 25, 2017, at 11:00 AM, Leroy Tennison
> wrote:
>>
>> Although "not my question", thanks, I learned a lot about array
>> processing from your example.
>
> Yeah, it’s amazing how many obscure corners of the Bash language must be
> tapped to solve such a simple problem.
Warren Young wrote:
> On Oct 25, 2017, at 10:02 AM, Mark Haney wrote:
>>
>> I have a file with two columns 'email' and 'total' like this:
>>
>> m...@example.com 20
>> m...@example.com 40
>> y...@domain.com 100
>> y...@domain.com 30
>>
>> I need to get the total number of messages for each email ad
On 10/25/2017 12:47 PM, Warren Young wrote:
You’re making things hard on yourself by insisting on Bash, by the way. This
solution is better expressed in Perl, Python, Ruby, Lua, JavaScript…probably
dozens of languages.
Yeah, you're right, I am. An associative array was the first thing I
thou
On Oct 25, 2017, at 11:00 AM, Leroy Tennison wrote:
>
> Although "not my question", thanks, I learned a lot about array processing
> from your example.
Yeah, it’s amazing how many obscure corners of the Bash language must be tapped
to solve such a simple problem. I count 7 features in that sc
Although "not my question", thanks, I learned a lot about array processing from
your example.
- Original Message -
From: "warren"
To: "centos"
Sent: Wednesday, October 25, 2017 11:47:12 AM
Subject: Re: [CentOS] [OT] Bash help
On Oct 25, 2017, at 10:02 AM, Mark Haney wrote:
>
> I have
On Wed, Oct 25, 2017 at 9:41 AM, Mark Haney wrote:
> On 10/25/2017 12:33 PM, Robert Arkiletian wrote:
>>
>> here is a python solution
>> #!/usr/bin/python
>> #python 2 (did not check if it works)
>> f=open('yourfilename')
>> D={}
>> for line in f:
>> email,num = line.split()
>> if email
On Oct 25, 2017, at 10:02 AM, Mark Haney wrote:
>
> I have a file with two columns 'email' and 'total' like this:
>
> m...@example.com 20
> m...@example.com 40
> y...@domain.com 100
> y...@domain.com 30
>
> I need to get the total number of messages for each email address.
This screams out for
On 10/25/2017 12:41 PM, Mark Haney wrote:
On 10/25/2017 12:33 PM, Robert Arkiletian wrote:
here is a python solution
#!/usr/bin/python
#python 2 (did not check if it works)
f=open('yourfilename')
D={}
for line in f:
email,num = line.split()
if email in D:
D[email] = D[email] +
On Wed, 2017-10-25 at 12:02 -0400, Mark Haney wrote:
> I know this is for CentOS stuff, but I'm at a loss on how to build a
> script that does what I need it to do. It's probably really logically
> simple, I'm just not seeing it. Hopefully someone will take pity on me
> and at least give me a
On 10/25/2017 12:33 PM, Robert Arkiletian wrote:
here is a python solution
#!/usr/bin/python
#python 2 (did not check if it works)
f=open('yourfilename')
D={}
for line in f:
email,num = line.split()
if email in D:
D[email] = D[email] + num
else:
D[email] = num
f.c
On Wed, Oct 25, 2017 at 9:02 AM, Mark Haney wrote:
> I know this is for CentOS stuff, but I'm at a loss on how to build a script
> that does what I need it to do. It's probably really logically simple, I'm
> just not seeing it. Hopefully someone will take pity on me and at least
> give me a big
I know this is for CentOS stuff, but I'm at a loss on how to build a
script that does what I need it to do. It's probably really logically
simple, I'm just not seeing it. Hopefully someone will take pity on me
and at least give me a big hint.
I have a file with two columns 'email' and 'total
Thanks for your reply
Actually the case is that the compiling process and make all, make install
processes didn't report any errors but when I trying to access or start the
service Nagios it gives me an error stating it's unable to find that service.
This happens with me when I try to manuall
28 matches
Mail list logo