From owner-freebsd-questions@FreeBSD.ORG Mon Oct 13 07:42:42 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9700106568B for ; Mon, 13 Oct 2008 07:42:42 +0000 (UTC) (envelope-from kheuer2@gwdg.de) Received: from tmailer.gwdg.de (tmailer.gwdg.de [134.76.10.23]) by mx1.freebsd.org (Postfix) with ESMTP id AB57E8FC12 for ; Mon, 13 Oct 2008 07:42:42 +0000 (UTC) (envelope-from kheuer2@gwdg.de) Received: from gwdu60.gwdg.de ([134.76.8.60]) by mailer.gwdg.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1KpI4e-0003Qo-Ko; Mon, 13 Oct 2008 09:42:40 +0200 Date: Mon, 13 Oct 2008 09:42:40 +0200 (CEST) From: Konrad Heuer To: Kelly Jones In-Reply-To: <26face530810120930u121e8658hb93b93bc32e52a3b@mail.gmail.com> Message-ID: <20081013092722.S9114@gwdu60.gwdg.de> References: <26face530810120930u121e8658hb93b93bc32e52a3b@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Level: - X-Virus-Scanned: (clean) by exiscan+sophie Cc: freebsd-questions@freebsd.org Subject: Re: Can tcsh report 'command had no output'? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 07:42:43 -0000 On Sun, 12 Oct 2008, Kelly Jones wrote: > Can I force tcsh to say "previous command returned empty stdout" or > something? I often cut and paste shell output for my cow-orkers, and > it's crucial to note when a command returns nothing. > > Currently, I insert the information manually: > >> ls | fgrep 'phrase' > [no results] > > but it'd be nice if tcsh had a setting to do this automatically? Afaik there is no such setting. You could try something like set output = `command` if ( "$output" == "" ) then echo "previous command returned empty stdout" else echo "$output" endif in your scripts (if you're scripting). Not perfect since newlines are removed by command substitution, but maybe a starting point ... Best regards Konrad Heuer GWDG, Am Fassberg, 37077 Goettingen, Germany, kheuer2@gwdg.de