From owner-freebsd-questions@FreeBSD.ORG Thu Jun 10 17:57:13 2010 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 B2FFC1065677 for ; Thu, 10 Jun 2010 17:57:13 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id 7849A8FC15 for ; Thu, 10 Jun 2010 17:57:13 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id o5AHvCse066667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 10 Jun 2010 12:57:12 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.4/8.14.4) with ESMTP id o5AHvC7H070357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 10 Jun 2010 12:57:12 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.4/8.14.3/Submit) id o5AHvBNe070356; Thu, 10 Jun 2010 12:57:11 -0500 (CDT) (envelope-from dan) Date: Thu, 10 Jun 2010 12:57:11 -0500 From: Dan Nelson To: Lowell Gilbert Message-ID: <20100610175711.GB5615@dan.emsphone.com> References: <1276190395.5437.53.camel@jane.spg.more.net> <44typa3hv7.fsf@be-well.ilk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44typa3hv7.fsf@be-well.ilk.org> X-OS: FreeBSD 8.1-PRERELEASE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.96 at email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Thu, 10 Jun 2010 12:57:12 -0500 (CDT) X-Scanned-By: MIMEDefang 2.45 Cc: freebsd-questions@freebsd.org, Dan D Niles Subject: Re: Switched to Bash and Comparison of Shells 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: Thu, 10 Jun 2010 17:57:13 -0000 In the last episode (Jun 10), Lowell Gilbert said: > Dan D Niles writes: > > > The which command functions differently between bash and tcsh. For > > example, I have ls aliased to do color output and add some other options > > that I like. With tcsh, 'which ls' returns > > "ls: aliased to \ls -GFB"; with bash it returns > > "/bin/ls". The tcsh behavior tells you what will be executed when you > > run ls. The bash behavior can be achieved in tcsh with 'which \ls', so > > I think I like the tcsh behavior better. I could probably write a > > function in bash that emulates tcsh's builtin which command. > > bash (like most other sh-style shells) has no "which" builtin. You end up > running /usr/bin/which. bash (like most other sh-style shells) does have > a (rough) equivalent, which is "type". zsh's which command will prints the output of aliases, and a very comprehensive completion system, too. It also supports more csh features/syntax than bash (good for people used to csh/tcsh). (dan@dan.13) /home/dan> which ls ls: aliased to ls -Fa -- Dan Nelson dnelson@allantgroup.com