I want print \"/\"
separator inside output title.
curl -s http://cd0a4a.ethosdistro.com/?json=yes \\
| jq -c \'.rigs|.\"0d6b27\",.\"50dc35\"|[.
Here are some suggestions for simplification:
--raw-output
option to jq
to remove extraneous back-slashescsvlook
does it for you.[]
Here is an example:
(
echo version,GPU_driver,miner,gpu
curl -s 'http://cd0a4a.ethosdistro.com/?json=yes' |
jq -r '
.rigs | .[] |
[ .version, .driver , .miner , "\(.gpus)/\(.miner_instance)" ] |
@csv
'
) |
csvlook
Output:
|----------+------------+----------+------|
| version | GPU_driver | miner | gpu |
|----------+------------+----------+------|
| 1.2.3 | nvidia | ethminer | 2/2 |
| 1.2.4 | amdgpu | ethminer | 1/1 |
|----------+------------+----------+------|