Skip to content

Instantly share code, notes, and snippets.

@kunst1080
kunst1080 / cross_tabulation.sh
Last active December 17, 2015 23:29
bashのワンライナーでクロス集計(※awkとsedを使わないプレイ) 使用コマンド:cat tr cut sort xargs bash grep bc echo Cross tabulation with bash, without sed and awk. using:cat tr cut sort xargs bash grep bc echo
#!/bin/bash
# 入力ファイルをTSVからCSV形式に変換する。ついでにヘッダの除去も行う
cat "$1" | tr -s ' ' | tr '\n' ',' | cut -d, -f2- | tr , '\n' | tr ' ' , | grep -v "^$" > tmp.input
# 1列目の項目を抜出し、キー1とする
cat tmp.input | cut -d, -f1 | sort -u > tmp.key1
# 2列目の項目を抽出し、キー2とする
cat tmp.input | cut -d, -f2 | sort -u > tmp.key2
@matope
matope / Dynamo: Amazonの高可用性Key-value Store.markdown
Last active November 18, 2022 17:54
Dynamo: Amazonの高可用性Key-value Store[和訳]
@ri0day
ri0day / memcache_cli.sh
Created December 30, 2011 08:54
bash memcache cli
#!/bin/bash
#filename cm.sh
#author:wumin
#---Date:2011.12.29 pm---
#notice:not suport kind of ubuntu and debian system.(debian not suport /dev/tcp/host/port stye )
usage() {
format_usage="Usage:\n