Last active
June 25, 2018 15:26
-
-
Save josep11/d1a13d702122632b964a263fe49b415f to your computer and use it in GitHub Desktop.
sed example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
awk '{s+=$1}END{print "\nAverage:",s/NR,"\n"}' numbers.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2018-06-25 16:38:04.738] [ info] BCN hashrate: 32.8485 H/s | |
[2018-06-25 16:38:14.739] [ info] BCN hashrate: 34.0966 H/s | |
[2018-06-25 16:38:22.076] [ info] New Job: job_id="34a2b30f-2dca-43d4-8678-d85c1dffdf4b" blob="0606bffcc3d905a3c6732349e0ffb0a371522581dd96210e88106522f31e447687726b1fedb9e10000000063423ad0c023638cf42bc0ae1a504aff587f562f216792b219fd41d962913a0501" target="e4a63d00" | |
[2018-06-25 16:38:22.076] [ info] New difficulty: 1063 | |
[2018-06-25 16:38:24.741] [ info] BCN hashrate: 28.3891 H/s | |
[2018-06-25 16:38:34.739] [ info] BCN hashrate: 26.1974 H/s | |
[2018-06-25 16:38:44.742] [ info] BCN hashrate: 27.2973 H/s | |
[2018-06-25 16:38:50.361] [ info] New Job: job_id="38f7bbd5-5dc7-4e25-a740-9671a0d07675" blob="0606bffcc3d905a3c6732349e0ffb0a371522581dd96210e88106522f31e447687726b1fedb9e1000000002a3a41298d9376f6d7791413d3286d63536a80406b1a810ab84a413e1d4ce9b301" target="e4a63d00" | |
[2018-06-25 16:38:50.361] [ info] New difficulty: 1063 | |
[2018-06-25 16:38:51.797] [ info] New Job: job_id="d781335c-981b-4f31-958a-70528ef7992b" blob="0606bffcc3d905a3c6732349e0ffb0a371522581dd96210e88106522f31e447687726b1fedb9e100000000d0816949fb11b43e2a861c851a10e7aace148a2af9f9f966135883f49430e11501" target="e4a63d00" | |
[2018-06-25 16:38:51.797] [ info] New difficulty: 1063 | |
[2018-06-25 16:38:54.743] [ info] BCN hashrate: 21.1958 H/s | |
[2018-06-25 16:39:04.742] [ info] BCN hashrate: 25.2 H/s | |
[2018-06-25 16:39:14.743] [ info] BCN hashrate: 27.5945 H/s | |
[2018-06-25 16:39:18.321] [ info] New Job: job_id="9da18663-2036-43bc-9e26-aa41b7ebcbfa" blob="0606bffcc3d905a3c6732349e0ffb0a371522581dd96210e88106522f31e447687726b1fedb9e100000000388748ef83682c6034c933d93871d1bcdd5892372d67c14b0e57bd99828953a201" target="e4a63d00" | |
[2018-06-25 16:39:18.321] [ info] New difficulty: 1063 | |
[2018-06-25 16:39:24.743] [ info] BCN hashrate: 31.1488 H/s | |
[2018-06-25 16:39:34.393] [ info] New Job: job_id="7511b9fd-14bc-4ffc-96dc-1f365fb5d609" blob="0606a6fdc3d905425efc0e5ad3fe632bd14c9aa5022aa61a00081775cf55a02f62a103ae138c470000000014257a625e8df8235bdf454025b353267bcf8d02be69c1f27fe259f91d5efd9b01" target="e4a63d00" | |
[2018-06-25 16:39:34.393] [ info] New difficulty: 1063 | |
[2018-06-25 16:39:34.741] [ info] BCN hashrate: 33.4933 H/s | |
[2018-06-25 16:39:44.743] [ info] BCN hashrate: 33.7966 H/s | |
[2018-06-25 16:39:49.961] [ info] New Job: job_id="5d3e13f6-f43d-4f0c-845a-89fb337e205a" blob="0606a6fdc3d905425efc0e5ad3fe632bd14c9aa5022aa61a00081775cf55a02f62a103ae138c47000000001e9b0485c3a36061b9b0eb432cd94edb6aa0386b7c7657a05ee0df77b7848bf501" target="e4a63d00" | |
[2018-06-25 16:39:49.961] [ info] New difficulty: 1063 | |
[2018-06-25 16:39:51.617] [ info] New Job: job_id="48bb3999-8ca0-454e-9d4b-35d2ee59623a" blob="0606a6fdc3d905425efc0e5ad3fe632bd14c9aa5022aa61a00081775cf55a02f62a103ae138c4700000000427a4bc62dfa80bf399614e9fe9e3d57f684a7116a5e852d97db351ea66df10601" target="e4a63d00" | |
[2018-06-25 16:39:51.617] [ info] New difficulty: 1063 | |
[2018-06-25 16:39:54.746] [ info] BCN hashrate: 33.5238 H/s | |
[2018-06-25 16:40:04.743] [ info] BCN hashrate: 23.0931 H/s | |
[2018-06-25 16:40:14.745] [ info] BCN hashrate: 25.8948 H/s | |
[2018-06-25 16:40:24.747] [ info] BCN hashrate: 25.3357 H/s | |
[2018-06-25 16:40:34.745] [ info] BCN hashrate: 26.9946 H/s | |
[2018-06-25 16:40:44.747] [ info] BCN hashrate: 27.3945 H/s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# cat outputsample.txt | grep H/s | sed -e 's/\(.*\)://' -e 's/\sH\/s//' > numbers.txt | |
cat outputsample.txt | grep H/s | awk '{print $7}' > numbers.txt | |
awk '{s+=$1}END{print "\nAverage:",s/NR,"\n"}' numbers.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment