From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9154 invoked by alias); 1 Sep 2015 23:16:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36388 Received: (qmail 15268 invoked from network); 1 Sep 2015 23:16:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=yxQ/61FlZkaHHWys48LUpfxawu2zLVnGPsLS523gfao=; b=ZKMujv6jfM5YULWDwOqUEIi2YwTEyPIVgVASXIpmbH0/p9AJc/Ht0TPgjpLpF66w24 XmMc1AQmmzMQEHFZWciTh0GZ6+4OukjjEctOfFUsJ7taV7jCJ+3lXct2Je65BNUVRDWz Xq4C8iPaCnwvIV4XVPMkobN9OeL49VncIV/tt8+tacwPuKXuVxiEwNB9nV1qoX+jpXZ0 nBwnje+v12eMJvAAley3mXNAspcYdu2HASPUI6IMzmzu4jVDlO69vanxfszqBwC1UHOL cz5aQVuOsCina6t9JK9Kt8xtddwV3ME968n17lGganOLfdmWkGCWDoIOHTzpNTZeekMb 6IsA== X-Gm-Message-State: ALoCoQmR1+6+MrFm9xC4VdIjcr+jFmMTvfWc0oHkfs2pr4bXK/QnGM12du3DbCkAb4YZRuFDQl8U X-Received: by 10.202.68.213 with SMTP id r204mr17969471oia.115.1441149393941; Tue, 01 Sep 2015 16:16:33 -0700 (PDT) From: Bart Schaefer Message-Id: <150901161630.ZM2441@torch.brasslantern.com> Date: Tue, 1 Sep 2015 16:16:30 -0700 In-Reply-To: Comments: In reply to Mikael Magnusson "Re: [patch] "which"-builtin writes diagnostics to stdout" (Sep 1, 8:12am) References: <20150830030614.GB18893@frozen.localdomain> <20150830052603.GE18893@frozen.localdomain> <150831230431.ZM894@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: [patch] "which"-builtin writes diagnostics to stdout MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 1, 8:12am, Mikael Magnusson wrote: } } I guess the problem here is that in other shells, whence does not } exist, and which prints 'not found' to stderr. As far as I can tell, in other shells "which notacommand" prints NOTHING on stdout or stderr. } Zsh's which acts like the csh variant even in the sh emulation, so } finding the absolute path of a command portably is pretty difficult. Really? This seems to work pretty well in bash/ksh/zsh (I don't have dash/ash to try): if absolute_path="$(which $1)" then echo "Absolute path of $1 is $absolute_path" fi