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 1IYOFE-000128-FW for garchives@archives.gentoo.org; Thu, 20 Sep 2007 15:47:13 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l8KFc3Qd023048; Thu, 20 Sep 2007 15:38:03 GMT Received: from bane.moelleritberatung.de (bane.moelleritberatung.de [77.37.2.25]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l8KFVTYs014795 for ; Thu, 20 Sep 2007 15:31:30 GMT Received: by bane.moelleritberatung.de (Postfix, from userid 1006) id 0EE575BAD5; Thu, 20 Sep 2007 17:31:25 +0200 (CEST) Date: Thu, 20 Sep 2007 17:31:25 +0200 From: Frank Gruellich To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] OT: Bash question Message-ID: <20070920153125.GB10595@der-frank.org> Mail-Followup-To: gentoo-user@lists.gentoo.org References: <46F23395.7030305@sbcglobal.net> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46F23395.7030305@sbcglobal.net> X-PGP-Key: http://www.der-frank.org/about/frank.gpg.asc User-Agent: Mutt/1.5.13 (2006-08-11) X-Archives-Salt: d2aee28f-a30f-4761-bfd8-2102cc8479fb X-Archives-Hash: a004c0ada7d652f75451205d40afc954 * 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. -- Sigmentation fault -- gentoo-user@gentoo.org mailing list