Tag Info

Hot answers tagged

3

Pure bash, one-liner: unset x y sum; while IFS=, read x y; do ((sum[$x]+=y)); done < input.csv; for i in ${!sum[@]}; do echo $i,${sum[$i]}; done Or in more readable form: unset x y sum while IFS=, read x y; do ((sum[$x]+=y)); done < input.csv for i in ${!sum[@]}; do echo $i,${sum[$i]} done The result: 100,400 201,400 300,600


3

Why can't the OpenSSH configure script detect OpenSSL explains the possible cause that might have occured in your case. Several reasons for problems with the automatic detection exist. OpenSSH requires at least version 0.9.5a of the OpenSSL libraries. Sometimes the distribution has installed an older version in the system locations that is detected ...


1

I know this is an older thread but I had a need for pulling the hostname and domain name separately in a script. ealgumby's response to use check-hostname was something I had never seen before so I gave it a try to great success for my needs. I would mark it as helpful but apparently I don't have the rep to do so. I set the domain as follows looping ...


1

With python this can be done more effectively. This program by default expects the file to be named as 'file.txt', which you can change if needed. #!/usr/bin/env python3 col1, col2 = [ list(y) for y in zip(*[ x.strip().split(',') for x in open('file.txt').readlines() if x != '\n' ]) ] for (offset,x) in enumerate(list(col1)): value = 0 while ...


1

I think this'll do: awk 'BEGIN{FS=OFS=","}{a[$1]+=$2}END{ for (i in a) print i,a[i]}'


1

While iostat and kstat are useful, since you've got Solaris with ZFS (so 10 or later), then you can take advantage of the Fault Management Architecture (FMA), which is tied in with zfs and many other parts of the OS. Look at the output from 'fmdump' to see if there have been any faults. As an example (with repeated output elided): $ fmdump -u ...


1

The 'ftp' command does not seem to return other error codes than 0. An alternative solution would be to check the FTP return codes. There is some examples in how to do this here: http://stackoverflow.com/a/4442763


1

The system is telling you there is a faulty disk (or controller/cable/whatever): Nov 2 12:04:21 hooradb2 scsi: Requested Block: 1632 Error Block: 1632 Nov 2 12:04:21 hooradb2 scsi: Vendor: SEAGATE Serial Number: 071891XA2J Nov 2 12:04:21 hooradb2 scsi: Vendor: SEAGATE Serial Number: 071891XA2J Nov 2 12:04:21 hooradb2 scsi: Sense Key: Aborted Command Nov 2 ...



Only top voted, non community-wiki answers of a minimum length are eligible