From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IYdwt-0001qO-I4 for garchives@archives.gentoo.org; Fri, 21 Sep 2007 08:33:20 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l8L8O6RY012835; Fri, 21 Sep 2007 08:24:06 GMT Received: from smtp120.sbc.mail.re3.yahoo.com (smtp120.sbc.mail.re3.yahoo.com [66.196.96.93]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l8L8JvRR008380 for ; Fri, 21 Sep 2007 08:19:57 GMT Received: (qmail 67047 invoked from network); 21 Sep 2007 08:19:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=sbcglobal.net; h=Received:X-YMail-OSG:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ahlvgguF/2/IpA6JANxJpQhylBCOAhWRga0iWsp8Df7e++FSIct9ef4Rs279bW3lIx/2jR+AaORmgdd2zYFbUHcEORzr30aIRr+7xMVOO482KvXNo9o9IQOZ5+rMHEqEdFIKusQ51D1ZPEKUd6YGUAfgw6wDUgF+VJ2RGMadI44= ; Received: from unknown (HELO ?192.168.1.100?) (tony.caudel@sbcglobal.net@70.136.17.50 with plain) by smtp120.sbc.mail.re3.yahoo.com with SMTP; 21 Sep 2007 08:19:56 -0000 X-YMail-OSG: 8K2UbWkVM1nr7Txq4xg518F6RlkLRbEC7wgXGp2j9R7rasjqYEwQ8K2CTDtYxzbOfEsW2HBicubXSSGtNYCwgKcjYdMU6o3oivunqeMu5fpRUOTxJNX8rQ-- Message-ID: <46F37EAB.8000800@sbcglobal.net> Date: Fri, 21 Sep 2007 03:19:55 -0500 From: "Anthony E. Caudel" User-Agent: Thunderbird 2.0.0.6 (X11/20070811) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] OT: Bash question References: <46F23395.7030305@sbcglobal.net> <20070920153125.GB10595@der-frank.org> In-Reply-To: <20070920153125.GB10595@der-frank.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 5fd5b877-1f63-4e64-b565-d216975c910a X-Archives-Hash: f999aa1c0db4ba26a05b51ca4f13c566 Frank Gruellich wrote: > * Anthony E. Caudel 20. Sep 07: > >> Is there any way to make "pushd" and "popd" (Bash built-ins) silent? >> [snip] For example: >> >> OLD_VER=$(pushd /boot; ls kernel-* | sort | head -1; popd) >> echo $OLD_VER >> /boot ~ kernel-2.6.22-gentoo-r2 ~ >> > > For that exact example... why you bother at all? $( ) opens a subshell > and cd's in subshells don't interact with parent shell so you could > simply write: > > OLD_VER=$(cd /boot; ls kernel-* | sort | head -1) > > or > > OLD_VER=`cd /boot; ls kernel-* | sort | head -1` > > if you want to be more compatible. Or am I missing a point? > > HTH, kind regards, > Frank. > Thanks, Frank. That is the best solution. Tony -- Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin -- gentoo-user@gentoo.org mailing list