From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24163 invoked by alias); 19 Mar 2014 15:23:30 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18633 Received: (qmail 9203 invoked from network); 19 Mar 2014 15:23:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=Xr3DZz19 c=1 sm=1 tr=0 a=ho05/JMXnVToLU2jax5/Hg==:117 a=ho05/JMXnVToLU2jax5/Hg==:17 a=HIA4oEAs-AEA:10 a=8nJEP1OIZ-IA:10 a=L-58LjjeoFBlDGx3eQAA:9 a=wPNLvfGTeEIA:10 Message-id: <5329B671.20705@eastlink.ca> Date: Wed, 19 Mar 2014 08:23:29 -0700 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: set -F kills read -t References: <20131202142614.GA27697@trustfood.org> <131202075840.ZM3182@torch.brasslantern.com> <140316122727.ZM11132@torch.brasslantern.com> <140316131323.ZM11227@torch.brasslantern.com> <5327B941.3060605@eastlink.ca> <140317235020.ZM30413@torch.brasslantern.com> <532872BE.1020408@eastlink.ca> <140318104505.ZM15560@torch.brasslantern.com> <5328C3D8.9020603@eastlink.ca> <532917CD.5060405@eastlink.ca> In-reply-to: Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit On 03/18/2014 10:30 PM, Jan Larres wrote: > The best way to do that, and presumably the way grep itself does it, is > to test whether stdin is connected to a terminal: > > mygrep() { > if [ -t 0 ]; then > echo terminal > else > read input > echo $input input > fi > } > > $ mygrep > terminal > $ echo foo | mygrep > foo input > Bloody marvellous! That scratches my itch just perfectly, thanks Jan. I wish there was some web site: "101 things you still don't know you can do with zsh, and why you want to know them".