Entries from 2019-03-12 to 1 day

jsonをpretty print

毎度echo打ってjqするのめんどかった $ echo '{"key":"value"}' | jq . { "key": "value" }ので、たいした処理じゃないけどスクリプト化 $ cd ~/bin $ touch ppj $ chmod 755 ppj#!/bin/sh # ppj = pretty print json echo "$1" | jq ..zshrcに追記、パスを…

配列をpretty print

consoleでまとまった数のデータを調べている時に、縦に見やすく並べたい irb(main):058:0* pp App.limit(5).pluck(:id, :title) (0.9ms) [Shard: master] SELECT `apps`.`id`, `apps`.`title` FROM `apps` LIMIT 5 [[1, "テストゲーム1"], [2, "TestApp2"], …

grepで複数除外

egrepコマンド使ってパターン指定 ~/Desktop ❯❯❯ ls -lg total 0 -rw-r--r-- 1 staff 0 Mar 12 20:35 one.log -rw-r--r-- 1 staff 0 Mar 12 20:35 three.log -rw-r--r-- 1 staff 0 Mar 12 20:35 two.log ~/Desktop ❯❯❯ ~/Desktop ❯❯❯ ls -lg | egrep -v 'one…