From 307c4257f2b627de8bb5e829c3ab9b1a4039c7f1 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Mon, 2 Jan 2012 22:50:59 +0100 Subject: Better `json` function Ref. 9b0af44766d2a2cc61ae0142ac3ec9f0bed75674 --- .functions | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to '.functions') diff --git a/.functions b/.functions index 833f5e6..0ae79c9 100644 --- a/.functions +++ b/.functions @@ -21,9 +21,7 @@ function httpcompression() { function json() { if [ -p /dev/stdin ]; then # piping, e.g. `echo '{"foo":42}' | json` - while read data; do - python -mjson.tool <<< "$data" | pygmentize -l javascript - done + python -mjson.tool | pygmentize -l javascript else # e.g. `json '{"foo":42}'` python -mjson.tool <<< "$*" | pygmentize -l javascript -- cgit v1.2.3