mathiasbynens/dotfiles — Issue #33: Allow piping to the `json` function
Author: mathiasbynens
Created: 2011-12-28 18:50:09+00:00
State: open

```
[08:46:58] ge kunt kijken of stdin een pipe is
[08:47:02] zie [ -p ]
[08:47:37] [ -p ]?
[08:47:56] -----[ 08:47:26 ] (!6737) [ :-) ] janmoesen@janbookpro ~
[08:47:56] $ echo pipe | [ -p /dev/stdin ]; echo $?;
[08:47:56] 0
[08:47:56] -----[ 08:47:36 ] (!6738) [ :-) ] janmoesen@janbookpro ~
[08:47:56] $ [ -p /dev/stdin ]; echo $?;
[08:47:58] 1
[08:48:01] -----[ 08:47:40 ] (!6739) [ :-) ] janmoesen@janbookpro ~
[08:48:03] $ [ -p /dev/stdin ] <<< 'foo'; echo $?;
[08:48:06] 1
[08:48:38] als ge iets pijpt naar uw functie, zal [ -p /dev/stdin ] succesvol (dus exit 0) zijn
```